← ClaudeAtlas

boost-asio-prolisted

Use when building asynchronous networking applications with Boost.Asio or standalone Asio — TCP/UDP servers and clients, SSL/TLS streams, async I/O via C++20 coroutines OR pre-C++20 callbacks/stackful coroutines, timers, strand-based concurrency, or composing async operations. Use when code involves io_context, co_spawn, awaitable, async_read, async_write, strand, asio::spawn, yield_context, or completion-handler callbacks (C++11 and up).
alexprivalov/boost-asio-skill · ★ 0 · AI & Automation · score 75
Install: claude install-skill alexprivalov/boost-asio-skill
# Boost.Asio / standalone Asio Write async C++ networking code that compiles on the *user's* Boost, not the newest one. Asio's API changed shape three times (classic `io_service` → `io_context` → C++20 coroutines) and most Asio code on the internet is from the first era, so **pick the style from the toolchain first**, then follow that style's reference file. **References:** [Boost.Asio](https://www.boost.org/doc/libs/latest/doc/html/boost_asio.html) · [standalone Asio](https://think-async.com/Asio/) ## Step 1: pick the style (do this before writing code) Determine the Boost (or Asio) version and the C++ standard actually in use — `find_package(Boost)` output, `dpkg -l libboost-dev`, `brew info boost`, `CMAKE_CXX_STANDARD`, or ask. Do not assume the newest. | Boost | C++ std | Style | Read | |-------|---------|-------|------| | ≥ 1.77 | C++20 | Coroutines (`co_await` + `awaitable<T>`) — preferred | [references/coroutines.md](references/coroutines.md) | | ≥ 1.74 | C++11–17 | Completion handlers (callbacks) — the portable baseline | [references/pre-cpp20.md](references/pre-cpp20.md) | | ≥ 1.80 | C++11–17 | Stackful `asio::spawn` + `yield_context` (links Boost.Coroutine — not header-only) | [references/pre-cpp20.md](references/pre-cpp20.md) | | 1.62–1.65 | C++11 | Classic `io_service` / `strand.wrap` / `expires_from_now` | [references/classic-boost.md](references/classic-boost.md) | SSL/TLS in any style: [references/ssl.md](references/ssl.md). CMake for any style: [referenc