Implementing a synchronous parallel TCP server

A synchronous parallel TCP server is a part of a distributed application that satisfies the following criteria:

  • Acts as a server in the client-server communication model
  • Communicates with client applications over TCP protocol
  • Uses I/O and control operations that block the thread of execution until the corresponding operation completes, or an error occurs
  • May handle more than one client simultaneously

A typical synchronous parallel TCP server works according to the following algorithm:

  1. Allocate an acceptor socket and bind it to a particular TCP port.
  2. Run a loop until the server is stopped:
    • Wait for the incoming connection request from a client
    • Accept the client's connection request
    • Spawn a thread of control ...

Get Boost.Asio C++ Network Programming Cookbook 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.