pub struct Receiver { /* private fields */ }Expand description
ARQ receiver-side state (draft-sharabayko-srt-01 §4.8.1/§4.8.2/§4.10).
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn new(dest_socket_id: u32, initial_seq: u32) -> Self
pub fn new(dest_socket_id: u32, initial_seq: u32) -> Self
A fresh receiver expecting initial_seq first (the peer’s ISN),
addressing dest_socket_id (the peer’s SRT Socket ID, §3).
Sourcepub fn ack_point(&self) -> u32
pub fn ack_point(&self) -> u32
The cumulative ack point — every seq strictly before this has been
delivered in order (rule 8’s ACK n + 1 semantics).
Sourcepub fn loss_list_len(&self) -> usize
pub fn loss_list_len(&self) -> usize
Number of sequence numbers currently believed lost.
Sourcepub fn feed_data(&mut self, seq_number: u32, now: Duration) -> FeedOutcome
pub fn feed_data(&mut self, seq_number: u32, now: Duration) -> FeedOutcome
Process one arriving data packet’s sequence number.
Sourcepub fn tick(&mut self, now: Duration) -> Vec<Vec<u8>>
pub fn tick(&mut self, now: Duration) -> Vec<Vec<u8>>
Advance to absolute time now and emit any periodic control packets
now due: a Full ACK every super::FULL_ACK_PERIOD (rule 11), a
Light ACK once super::LIGHT_ACK_THRESHOLD packets have arrived
since the last ACK (rule 12), and a periodic NAK once NAKInterval
has elapsed and the loss list is non-empty (rules 21, 22) — never a
NAK when nothing is believed lost.
Sourcepub fn on_ackack(&mut self, ackack: &AckAckPacket, now: Duration)
pub fn on_ackack(&mut self, ackack: &AckAckPacket, now: Duration)
Process an incoming ACKACK: match it against the outstanding Full ACK it acknowledges and update RTT/RTTVar from the round-trip sample (rules 26-30). An ACKACK for an unknown/already-matched Acknowledgement Number is ignored.