Chapter 3 Sending and Receiving Messages

When writing programs to communicate via sockets, you will generally be implementing an application protocol of some sort. Typically you use sockets because your program needs to provide information to, or use information provided by, another program. There is no magic: Sender and receiver must agree on how this information will be encoded, who sends what information when, and how the communication will be terminated. In our echo example, the application protocol is trivial: neither the client’s nor the server’s behavior is affected by the contents of the bytes they exchange. Because most applications require that the behaviors of client and server depend upon the information they exchange, application ...

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.