Implementing a synchronous TCP client

A synchronous TCP client is a part of a distributed application that complies with the following statements:

  • Acts as a client in the client-server communication model
  • Communicates with the server application using a TCP protocol
  • Uses I/O and control operations (at least those I/O operations that are related to communication with a server) that block the thread of execution until the corresponding operation completes, or an error occurs

A typical synchronous TCP client works according to the following algorithm:

  1. Obtain the IP-address and the protocol port number of the server application.
  2. Allocate an active socket.
  3. Establish a connection with the server application.
  4. Exchange messages with the server.
  5. Shut down the connection. ...

Get Boost.Asio C++ Network Programming Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.