Studying an example on thread logging

The final example in this chapter will build upon our existing debugger example to add support for multiple clients. In Chapter 10, Programming POSIX Sockets Using C++, we added support for networking to the example debugger, providing the ability to offload our debugging logs to a server in addition to the local system.

The problem with this is that the server could only accept one connection before closing, as it didn't have the logic for handling more than one client. In this example, we will fix that issue.

To start, we will need to define our port and max debug string length, as follows:

#define PORT 22000#define MAX_SIZE 0x1000

The server will require the following include statements:

#include ...

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.