Summary
In this chapter, we learned about Boost.Asio and how to use this library to manage asynchronous tasks that deal with external resources managed by the OS.
For that purpose, we introduced the I/O objects and I/O execution context objects, with an in-depth explanation of how they work and interact together, how they access and communicate with OS services, what the design principles are behind them, and how to use them properly in single-threaded and multi-threaded applications.
We also showed different techniques available in Boost.Asio to serialize work using strands, to manage the objects’ lifetimes used by asynchronous operations, how to start, interrupt, or cancel tasks, how to manage the event processing loop that the library uses, and how to handle signals sent by the OS.
Other concepts related to networking and coroutines were also introduced, and we also implemented some useful examples using this powerful library.
All these concepts and examples allow...