Skip to content

Client corosio - #40

Merged
pgit merged 2 commits into
masterfrom
client-corosio
Nov 6, 2026
Merged

pgit merged 2 commits into
masterfrom
client-corosio

Conversation

@pgit

@pgit pgit commented Nov 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

pgit and others added 2 commits November 6, 2026 20:58
The protocol backends are anyhttp::h1, h2, h2v2, quic and h3, instead of
beast_impl, nghttp2 (both HTTP/2 backends) and http3, and so is what their
backend headers offer generic code: quic::QuicServer, quic::make_quic_server(),
h3::make_http3_application(), h3::async_connect_http3(). The role files in
quic/ and h3/ are in their protocol's namespace, no longer in anyhttp::server
or anyhttp::client. h2v2/ defines the factories of h2/backend.hpp in
anyhttp::h2, where they are declared, so that nothing above that header can
tell the two HTTP/2 backends apart.

The runtimes are the inline namespaces anyhttp::asio and anyhttp::corosio.
Their vocabulary is still named as anyhttp's, but its symbols carry the
runtime, so code of the two runtimes cannot link together. code() moves in
from the global namespace, and normalize(IpAddress), which each runtime
defines, is declared by the runtimes rather than common.hpp.

That takes the names asio and corosio inside anyhttp: the aliases for
boost::asio and boost::corosio are gone and Boost's namespaces are spelled
in full, also in the tests and examples, where an alias of the same name is
ambiguous with using namespace anyhttp. any_async_stream.hpp no longer
leaks the global aliases asio and ip.

Generic code must not reopen a runtime's namespace: clang makes
"namespace anyhttp::io" a namespace of its own instead of extending the
inline one, as GCC does, so net.hpp and net.cpp open the runtime's io by
#if. Doxygen gets an input filter that presents the runtime's names as
anyhttp's, as the reference has them. CLAUDE.md has both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
client_main.cpp is written on the runtime layer now, like the server program: Task, launch(),
when_both() and the coroutine forms connect(), submit(), write_eof() and shutdown(), instead of
Asio's awaitable, co_spawn and awaitable operators. Errors are printed and end the program with 1
rather than escaping run(), the session is shut down cleanly, --help prints the usage, and an
optional third argument names the CA file, without which https fails verification.

The client is built and installed on both runtimes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pgit
pgit merged commit 296e8ee into master Nov 6, 2026
12 checks passed
@pgit
pgit deleted the client-corosio branch November 6, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant