Search code examples
.netsocketsnio

C# ==> High performance server?


I know that in java when u want to create a high performance server you use nio instead of the regular socket. So is there such a thing for C#, to create high performance servers?


Solution

  • Yes, SocketAsyncEventArgs:

    The SocketAsyncEventArgs class is part of a set of enhancements to the System.Net.Sockets.Socket class that provide an alternative asynchronous pattern that can be used by specialized high-performance socket applications. This class was specifically designed for network server applications that require high performance. An application can use the enhanced asynchronous pattern exclusively or only in targeted hot areas (for example, when receiving large amounts of data).