Chapter 2 Basic Sockets

You are now ready to learn to write your own socket applications in C#. One of the advantages of the C# programming language is its use of Microsoft’s .NET framework, which provides a powerful library of APIs for programming. Among the class libraries provided are the System.Net and System. Net. Sockets namespaces, and most of this book is dedicated to how to use the socket APIs provided there. In this chapter we begin by demonstrating how C# applications identify network hosts. Then, we describe the creation of TCP and UDP clients and servers. The .NET framework provides a clear distinction between using TCP and UDP, defining a separate set of classes for both protocols, so we treat each separately. Finally, we discuss ...

Get TCP/IP Sockets in C# 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.