pub struct ListenerHandshake { /* private fields */ }Expand description
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.
Implementations§
Source§impl ListenerHandshake
impl ListenerHandshake
Sourcepub fn new(own_socket_id: u32, syn_cookie: u32, config: HandshakeConfig) -> Self
pub fn new(own_socket_id: u32, syn_cookie: u32, config: HandshakeConfig) -> Self
Creates a fresh Listener handshake in ListenerHandshakeState::Idle,
with the SYN Cookie it will hand out on INDUCTION and check on
CONCLUSION.
Sourcepub fn state(&self) -> ListenerHandshakeState
pub fn state(&self) -> ListenerHandshakeState
The current state.
Sourcepub fn negotiated(&self) -> Option<&NegotiatedParams>
pub fn negotiated(&self) -> Option<&NegotiatedParams>
The negotiated parameters, once ListenerHandshakeState::Connected.
Sourcepub fn feed(
&mut self,
packet: &ControlPacket<'_>,
) -> Result<Vec<HandshakeOutput>>
pub fn feed( &mut self, packet: &ControlPacket<'_>, ) -> Result<Vec<HandshakeOutput>>
Feeds an inbound control packet.
§Errors
Error::UnexpectedControlPacket if packet is not a Handshake
packet; Error::HandshakeOutOfSequence if fed outside
ListenerHandshakeState::Idle / ListenerHandshakeState::AwaitingConclusion
(a driver bug, not a peer failure).
Sourcepub fn feed_bytes(&mut self, bytes: &[u8]) -> Result<Vec<HandshakeOutput>>
pub fn feed_bytes(&mut self, bytes: &[u8]) -> Result<Vec<HandshakeOutput>>
Convenience wrapper: parses bytes as a ControlPacket then
Self::feeds it.
Sourcepub fn tick(&mut self) -> Vec<HandshakeOutput>
pub fn tick(&mut self) -> Vec<HandshakeOutput>
Advances retransmit timing by one caller-defined tick, mirroring
crate::caller::CallerHandshake::tick.