Skip to main content

Module caller

Module caller 

Source
Expand description

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

CallerHandshake is a driveable, sans-IO state machine: CallerHandshake::start returns the INDUCTION handshake bytes to send; CallerHandshake::feed consumes an inbound (already-parsed) ControlPacket and returns the HandshakeOutputs produced — further bytes to send, the negotiated parameters on success, or a rejection. No sockets, no clock: retransmit timing is driven by CallerHandshake::tick calls from the caller.

Flow implemented (§4.3.1.1 / §4.3.1.2):

  1. start(): send INDUCTION (Version 4, Encryption Field 0, Extension Field 2, SYN Cookie 0).
  2. feed() the Listener’s INDUCTION response: validate Version 5 and the SRT magic code 0x4A17, capture the cookie and Listener’s Socket ID, then send CONCLUSION (Version 5, the captured cookie, HSREQ + optional Stream ID / Group extensions).
  3. feed() the Listener’s CONCLUSION response: validate it, decode its Handshake Extension Message, and reach CallerHandshakeState::Connected with NegotiatedParams — or CallerHandshakeState::Rejected on any validation failure or explicit peer rejection.

Structs§

CallerHandshake
A driveable Caller-side SRT handshake (draft-sharabayko-srt-01 §4.3.1).

Enums§

CallerHandshakeState
Caller-side handshake lifecycle state (draft-sharabayko-srt-01 §4.3.1).