O'Reilly logo

Boost.Asio C++ Network Programming by John Torjo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ('\n')
  • 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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required