In order to solve this problem, we will use the Asio library again. However, this time we need to write two programs: a server and a client. The server accepts TCP connections on a particular port, opens a connected socket, and starts reading on the socket. When it reads something from the socket, it interprets it as a number for the Fizz-Buzz game, writes back the answer, and continues to wait for another input. The client connects to a host on a particular port, sends a number read from the console, and then waits to receive an answer from the server before printing it to the console.
On the server side, the implementation of the Fizz-Buzz game is rather straightforward and should not require additional explanations. ...