Expand description
Dialling the daemon (blueprint §4.2, §7.2).
Local node listener on TCP 7408 (loopback) and a Unix domain socket (
$XDG_RUNTIME_DIR/astrs/daemon.sock) — UDS preferred, TCP fallback.
The node tries every endpoint its configuration names, in order, and keeps every failure: “connection refused on the Unix socket” and “no route to host on the TCP fallback” are two different diagnoses, and an error that reports only the last one sends an operator to the wrong place.
§What this module produces
A NodeLink: a framed duplex whose halves are boxed trait objects,
so a Unix socket, a TCP socket and the testing harness’s
tokio::io::duplex pair are all the same type from here on. That is what
lets crate::Node be one concrete type instead of being generic over
its transport, and it is what makes the in-process mock daemon speak the
real protocol rather than a stub of it.
Structs§
- Node
Link - A live, greeted connection to the daemon.
Constants§
- LINK_
BUFFER_ CAPACITY - The read-buffer capacity a node’s link starts with.
Functions§
- dial
- Dials the first endpoint that answers, then greets it.
- dial_
one - Dials exactly one endpoint.
- fresh_
counters - The counters a freshly wrapped link starts with, exposed so a caller can share one set across a reconnect.
- node_
handshake_ params - The handshake parameters a node presents (§7.2).
- wrap_
stream - Wraps an already-open byte stream in the node link’s frame codec.
Type Aliases§
- Link
Duplex - A framed duplex over a type-erased transport.
- Link
Reader - The read half of a node’s daemon link, type-erased.
- Link
Writer - The write half of a node’s daemon link, type-erased.