...
首页> 外文期刊>MSDN Magazine >Get Closer To The Wire With High-Performance Sockets in .NET
【24h】

Get Closer To The Wire With High-Performance Sockets in .NET

机译:.NET中具有高性能套接字的功能,使其与电线更接近

获取原文
获取原文并翻译 | 示例
           

摘要

Sockets are the transport mechanism most frequently used in high-performance server applications. Fortunately, the Win32~® Windows~® Sockets library (Winsock) provides mechanisms to improve the performance of programs that use sockets, and the Microsoft~® .NET Framework provides a layer over Winsock so that managed applications can communicate over sockets (see Figure 1). So much advanced socket support is great, but using all these layers to write a truly high-performance socket-based application requires a little background information. I am going to write a trivial chat server app to explore methods for writing a socket-based server and client using the base Sys-tem.Net.Sockets.Socket class. Although .NET provides higher-level abstractions like the TcpListener and TcpClient classes (also in System.NetSockets), these classes are missing some of the advanced features exposed by the lower-level Socket class. That said, they can be useful in many situations. The TcpListener class provides simple methods that listen for and accept incoming connection requests in blocking synchronous mode, while the TcpClient class provides simple methods for connecting, sending, and receiving stream data over a network in synchronous blocking mode.
机译:套接字是高性能服务器应用程序中最常使用的传输机制。幸运的是,Win32〜®Windows〜®套接字库(Winsock)提供了提高使用套接字的程序性能的机制,而Microsoft〜.NET Framework在Winsock上提供了一层,以便托管应用程序可以通过套接字进行通信(参见图1)。 1)。如此多的高级套接字支持非常棒,但是使用所有这些层来编写真正高性能的基于套接字的应用程序需要一些背景信息。我将编写一个简单的聊天服务器应用程序,以探索使用基础Sys-tem.Net.Sockets.Socket类编写基于套接字的服务器和客户端的方法。尽管.NET提供了更高级别的抽象(例如TcpListener和TcpClient类)(也在System.NetSockets中),但这些类缺少了较低级别Socket类公开的一些高级功能。也就是说,它们在许多情况下都很有用。 TcpListener类提供简单的方法,以阻塞同步模式侦听和接受传入的连接请求,而TcpClient类提供简单的方法,以同步阻塞模式通过网络连接,发送和接收流数据。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号