Skip to main content

Module listener

Module listener 

Source
Expand description

Listener-side handshake engine — draft-sharabayko-srt-01 §4.3.1 (Caller-Listener Handshake), Listener role.

ListenerHandshake is the mirror of crate::caller::CallerHandshake: it starts passively (no output) and reacts to inbound handshake packets via ListenerHandshake::feed.

Flow implemented (§4.3.1.1 / §4.3.1.2):

  1. feed() the Caller’s INDUCTION: reply with an INDUCTION response (Version 5, the SRT magic code 0x4A17, the configured/derived SYN Cookie) regardless of what the Caller sent — per §4.3.1.1 the Listener “still does not know if the Caller is SRT or UDT” at this point and “responds with the same set of values regardless.”
  2. feed() the Caller’s CONCLUSION: validate Handshake Type, Version, the echoed SYN Cookie, and decode the extensions (HSREQ, optional Stream ID / Group). On success, reply with the CONCLUSION response (HSRSP + optional Group) and reach ListenerHandshakeState::Connected with NegotiatedParams. On failure, reply with a rejection handshake packet (Handshake Type = 1000 + code, §4.3, Table 7) and reach ListenerHandshakeState::Rejected.

Structs§

ListenerHandshake
A driveable Listener-side SRT handshake (draft-sharabayko-srt-01 §4.3.1). syn_cookie is supplied by the caller/driver — this crate’s core never reads a clock or a socket address; see crate::handshake_sm::derive_cookie for a ready-made (non-standardized) derivation helper.

Enums§

ListenerHandshakeState
Listener-side handshake lifecycle state (draft-sharabayko-srt-01 §4.3.1).