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:
parent
47f2325664
commit
f8024b7a43
5 changed files with 204 additions and 19 deletions
16
interfaces/Crafter.Debug.Cli-Quic.cppm
Normal file
16
interfaces/Crafter.Debug.Cli-Quic.cppm
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// The client's transport: a Connection over QUIC to an instance's port on
|
||||
// 127.0.0.1, one stream per request. The library's :Transport describes the
|
||||
// wire.
|
||||
export module Crafter.Debug.Cli:Quic;
|
||||
import std;
|
||||
import Crafter.Debug.Core;
|
||||
import :Client;
|
||||
|
||||
export namespace Crafter::Debug::Cli {
|
||||
// Connects on the first call and keeps the connection for later ones,
|
||||
// reconnecting after one is lost. Needs Crafter.Thread's pool running.
|
||||
std::unique_ptr<Connection> ConnectQuic(const InstanceRecord& instance);
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// The crafter-debug client, as a library so tests can run it in process.
|
||||
// The crafter-debug client, as a library so tests can run it in process:
|
||||
// the program (:Client) and its QUIC transport (:Quic).
|
||||
export module Crafter.Debug.Cli;
|
||||
export import :Client;
|
||||
export import :Quic;
|
||||
|
|
|
|||
Loading…
Reference in a new issue