pub struct ReliableDataOutputChannel { /* private fields */ }Expand description
Converts application data into ordered, fragmented reliable data packets.
Implementations§
Source§impl ReliableDataOutputChannel
impl ReliableDataOutputChannel
Sourcepub fn new(
config: OutputConfig,
cipher: Option<Rc4KeyState>,
now: Instant,
) -> Self
pub fn new( config: OutputConfig, cipher: Option<Rc4KeyState>, now: Instant, ) -> Self
Creates a new output channel. cipher is the initial RC4 key state; pass
Some(..) to enable RC4 encryption of the proxied application data, or None
to pass it through unencrypted.
Sourcepub fn stats(&self) -> &DataOutputStats
pub fn stats(&self) -> &DataOutputStats
Returns the gathered output statistics.
Sourcepub fn take_outgoing(&mut self) -> Vec<OutgoingReliable>
pub fn take_outgoing(&mut self) -> Vec<OutgoingReliable>
Drains the outgoing reliable data packets accumulated so far.
Sourcepub fn queued_len(&self) -> usize
pub fn queued_len(&self) -> usize
Returns the number of reliable data packets currently awaiting acknowledgement.
Sourcepub fn set_max_data_length(&mut self, max_data_length: usize)
pub fn set_max_data_length(&mut self, max_data_length: usize)
Sets the maximum length of the data portion (sequence + data) of a single packet. Should not be called after data has been enqueued.
Sourcepub fn enqueue_data(&mut self, data: &[u8])
pub fn enqueue_data(&mut self, data: &[u8])
Enqueues application data to be sent on the reliable channel. The data is fragmented as required to fit within the configured maximum packet length.
Sourcepub fn run_tick(&mut self, now: Instant)
pub fn run_tick(&mut self, now: Instant)
Runs a tick of the output channel, moving due packets into the outgoing
buffer. If no acknowledgement has been received within the configured
ack_wait, dispatch restarts from the front of the window.
Sourcepub fn notify_of_acknowledge(&mut self, sequence: u16, now: Instant)
pub fn notify_of_acknowledge(&mut self, sequence: u16, now: Instant)
Notifies the channel that the remote has acknowledged a single sequence.
Sourcepub fn notify_of_acknowledge_all(&mut self, sequence: u16, now: Instant)
pub fn notify_of_acknowledge_all(&mut self, sequence: u16, now: Instant)
Notifies the channel that the remote has acknowledged all sequences up to and including the given one.