macula_peering_conn (macula v3.13.0)
View SourcePer-peer connection state machine.
Implements the lifecycle from Part 4 §10 simplified for Phase 1: no REFRESH phase, no RECONNECTING — just enough to exchange signed CONNECT/HELLO frames and drain on GOODBYE.
State graph:
client: connecting → handshaking → connected → draining → (terminate)
server: awaiting_start → handshaking → connected → draining → (terminate)
Summary
Types
-type connect_opts() :: #{host := binary() | string(), port := inet:port_number(), alpn => [binary()], timeout_ms => timeout(), _ => _}.
-type opts() :: #{role := client | server, identity := macula_identity:key_pair(), realms := [macula_identity:pubkey()], capabilities := non_neg_integer(), controlling_pid := pid(), target => connect_opts(), quic_conn => reference()}.