Asynchronous IO with Boost.Asio
summary
Boost.Asio provides a portable proactor model for scalable asynchronous I/O so you avoid one-thread-per-connection; examples use io_service, async_* timers/reads/writes, buffer/streambuf views, and shared_from_this to manage lifetime. A simple TCP chat server is built: acceptor hands sockets to per-connection handlers, reads requeue themselves, sends queue on a strand so only one write runs at a time, and multiple threads service completions. Demo shows the pattern working and recommends Boost.Asio, Beast, Spirit and MSM for parsing and layering.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:20Overview
- 2:25What is asynchronous IO
- 4:20Why asynchronous IO
- 5:20Story
- 9:23Purpose
- 10:46Lessons
- 12:22Timers
- 17:46PostWork
- 22:36Buffers
- 25:53Client Handler Ownership
- 30:32Generic Server
- 32:53Start Server
- 36:13Check for Errors
- 37:36Chat Handler
- 42:03Read Package
- 49:38Packets
- 51:40Summary
- 57:58Separate IO services
- 59:33General IO abstraction
related talks
58mThe Networking TS in Practice: Testable, Composable Asynchronous I/O in C++
58mThe Networking TS from Scratch: I/O Objects
59mThe Networking TS in Practice: Patterns for Real World Problems
01h 01mPractical Patterns with the Networking TS
49mNeed for ASYNC: in pursuit of scalable internet-scale applications
01h 21mCreating a Sender/Receiver HTTP Server for Asynchronous Operations in C++
01h 16mApplied C++20 Coroutines
01h 14mHow to Use C++20 Coroutines for Networking
