Programming POSIX Sockets Using C++

In this chapter, you will learn how to program POSIX sockets using C++17, including more common C++ paradigms, such as Resource Aquisition Is Initialization (RAII). To begin with, this chapter will discuss what a socket is, and the difference between UDP and TCP. The POSIX APIs will be explained in detail prior to walking you through five different examples. The first example will step you through programming with POSIX sockets by creating a UDP echo server example. The second example will create this same example using TCP instead of UDP and explain the differences. The third example will expand upon our existing debug logger that has been created in previous chapters, while the fourth and fifth examples ...

Get Hands-On System Programming with 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.