Chapter 4. Client and Server
In this chapter, we're about to delve into building non-trivial client and server applications using Boost.Asio. You can run and test them, and once you understand them, you can use them as skeletons to build your own applications.
In the following examples:
- The client logs in to the server with a username (no password)
- All connections are initiated by the client, where client asks and server answers
- All requests and answers are finished with a line feed (
- Server disconnects any client that hasn't pinged for 5 seconds
The client can make the following requests:
- Get a list of all connected clients
- The client can ping, and when it pings, the server answers either with
ping ok or
ping client_list_chaned (in the latter case, ...