client library

Client layer: the hub, links and pipes of the pipe transport.

Import this for:

  • MagHub - binds one shared UDP socket and multiplexes every connection registered on it;
  • BridgeLink / DirectLink - the connection to the relay server (B=1, with the three-way handshake, heartbeat and permits) or directly to a peer (B=0, stateless);
  • MagPipe / BridgePipe / DirectPipe - the send/receive endpoints backed by the links;
  • MagpieDelegate - observes every packet received through the links.

Classes

The base class for links: the shared state (socket, enigma, config, delegate), the scheduling predicates and the send path (signing, deferral) - the concrete links add the handshake state machines.
BridgeFactory
Factory: builds bridge pipes and wires the app's delegate.
Link to the relay server (B=1): handshake waves and system command handling are implemented; data packets are answered with "COPY" and handed to the pipe of the source peer.
BridgePipe
DirectFactory
Factory: builds direct pipes and wires the app's delegate.
Link to a peer directly (B=0): the three-way handshake (SYN?/SYN!/ ACK!) establishes the connection without secret/token; data packets are answered with "COPY" and handed to the pipe to process.
DirectPipe
MagHub
UDP hub: wraps one shared socket and multiplexes every MagLink registered on it.
Link: one connection over the shared UDP socket - to the relay server (B=1) or directly to a peer (B=0).
MagpieDelegate
The app layer's observer: receives every packet received through the link (docs/client.md section 4.2).
MagPipe
Pipe: processes data packets forwarded by the MagLink.