O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Sockets

The Windows operating system has long included a Windows Sockets (Winsock) interface for developers to make network connections using TCP/IP or UDP/IP. The System.Net.Sockets namespace provides a managed implementation of Winsock for the .NET Framework.

TCP is a connection-oriented protocol, so to make a connection there must be a socket listening for incoming TCP requests on the target system. On the client system, you then create a socket to make an outgoing request. The System.Net.Sockets namespace includes the TcpListener and the TcpClient classes, which contain simple methods to perform this kind of transaction. These classes send and receive data in a blocking synchronous mode. To perform asynchronous communications, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required