Evolving C++ Networking with Senders & Receivers [part 2]
summary
Implements a production TCP server atop Linux epoll using std::execution (senders & receivers), plus an eoll-based file‑descriptor wrapper, merged stop_source/stop_token fan‑in, and a small helper to emplace immovable operation_states without moves. Adds primitives: let_value/just, repeat/branch/sequence, variant sender, async mutex and an async queue; composes them to read datacon messages, handle heartbeats and cancellation semantics. Compiles and runs; demo shows request/ack/intermediate payload/heartbeat and cancel→cancel‑ack, and unit tests exercise cancellation. type erasure of receivers zero‑allocation structured concurrency
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:06Handling multiple readiness types
- 8:30Starting operations for readability/writability
- 14:11Reading bytes asynchronously
- 21:53Handling a single request
- 31:42Cancellation in networking
- 41:11Dynamic fan out with branch
- 47:06Transitioning to async domain
- 50:40Q&A: Performance and assembly
- 54:16Q&A: Repeat and shot senders
- 57:07Q&A: Promises vs senders
- 58:52Q&A: One-shot senders
- 1:00:21Q&A: Execution contexts
