O'Reilly logo

Boost.Asio C++ Network Programming Cookbook by Dmytro Radchuk

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

Implementing a synchronous UDP client

A synchronous UDP 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 UDP protocol
  • Uses I/O and control operations (at least those I/O operations that are related to communication with the server) that block the thread of execution until the corresponding operation completes, or an error occurs

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

  1. Obtain an IP-address and a protocol port number of each server the client application is intended to communicate with.
  2. Allocate a UDP socket.
  3. Exchange messages with the servers.
  4. Deallocate the socket.

This recipe ...

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