Summary

There are three basic steps when it comes to developing a network application. The first step includes establishing a connection between the source and target, which means the client and server. We can configure the socket object along with the acceptor object to establish the connection.

Secondly, we exchange data by reading and writing to the socket. For this purpose, we can use the basic_stream_socket functions collection. In our previous example, we used the boost::asio::async_write() method to send the data and the boost::asio::async_read() method to receive the data. Finally, the last step is releasing the connection. By using the shutdown() method in the ip::tcp::socket object, we can disable the sending and receiving of data on ...

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