.NET Networking Transport Classes

Because TCP and UDP protocols are used so often, Microsoft built wrapper classes to handle most of the functionality required of a TCP or UDP client/server distributed application. These classes are TcpListener, TcpClient, and UdpClient. Because UDP is a connectionless protocol, the client and server can be handled with one class so there is not a UdpListener class.

Building a client/server application using these classes is similar to building an application using the Socket class. A higher level abstraction is involved, but the sequence of calls is essentially the same. For all but the specialized applications, you should use these classes.

UDP Class

A server using the UdpClient class is shown starting with ...

Get .NET Common Language Runtime Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.