C# .NET Web Developer's Guide

Networking can be defined, in a general sense, as inter-process communication. Two or more processes (such as applications) communicate with each other. The processes can run on the same or different computers or other physical devices. Connections between the network nodes are made mostly by a wire (such as local area network [LAN], wide area network [WAN], and Internet); by wireless via radio frequencies (such as cell phone, wireless appliances, wireless LAN, Internet, and Bluetooth); or by infrared (IR) light (such as a cell phone to a laptop).
In this chapter, we cover the basics of networking and how it is accomplished with C#. We start out with some theory, covering a little bit about the history of networking and the Internet and sockets; then we discuss commonly used protocols such as the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Subsequently, we have a look at ports and their uses. The last point of theory is to get to know the .NET classes we use.
Keeping theory in mind, we then go into practice. First, we develop some very simple communication examples using TCP and UDP. Then we develop a multicast news ticker. We have a look at a chat server and client, where we combine the learned techniques. After all the client/server-applications, we develop a P2P file sharing system, and finally, we show how you can use special .NET classes that encapsulate the networking.