feat(cli): reach instances over QUIC

crafter-debug had a placeholder transport that reported every instance
unreachable. Cli::ConnectQuic dials 127.0.0.1 at the port in the
discovery record on the first call, keeps the connection for the next,
and dials again after one is lost. Each call opens a stream, sends the
request with a FIN, and reads lines: one with a result or an error is
the reply, anything before it a stream line for onLine, which runs on
the calling thread so a slow terminal never stalls msquic's worker.
Past the deadline the stream is aborted and the call times out.

The handshake gives up after 3 s, and keep-alives every 2 s hold a
quiet follow or a long wait open under the 10 s idle timeout. main
starts a pool with one worker, which Network reports some failures on,
and ends with _Exit once Run has closed its connections, since msquic's
teardown at exit waits on connections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-11-01 03:07:09 +01:00
commit f8024b7a43
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
5 changed files with 204 additions and 19 deletions

View file

@ -172,7 +172,7 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
cli.mtune = cfg.mtune;
cli.sysroot = cfg.sysroot;
cli.debug = cfg.debug;
cli.dependencies = { &core };
cli.dependencies = { &core, network };
client.dependencies = { &cli };
{
@ -196,8 +196,8 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
core.GetInterfacesAndImplementations(interfaces, implementations);
}
{
std::array<fs::path, 2> interfaces = { "interfaces/Crafter.Debug.Cli-Client", "interfaces/Crafter.Debug.Cli" };
std::array<fs::path, 1> implementations = { "implementations/Crafter.Debug.Cli-Client" };
std::array<fs::path, 3> interfaces = { "interfaces/Crafter.Debug.Cli-Client", "interfaces/Crafter.Debug.Cli-Quic", "interfaces/Crafter.Debug.Cli" };
std::array<fs::path, 2> implementations = { "implementations/Crafter.Debug.Cli-Client", "implementations/Crafter.Debug.Cli-Quic" };
cli.GetInterfacesAndImplementations(interfaces, implementations);
}
{