pub struct StreamMuxSender { /* private fields */ }Expand description
Sender side of the stream multiplexer.
Implementations§
Source§impl StreamMuxSender
impl StreamMuxSender
Sourcepub fn bind<A: ToSocketAddrs>(
local: A,
peer: SocketAddr,
symbol_len: usize,
conn_window: u32,
per_stream_window: u32,
) -> Result<Self>
pub fn bind<A: ToSocketAddrs>( local: A, peer: SocketAddr, symbol_len: usize, conn_window: u32, per_stream_window: u32, ) -> Result<Self>
Bind a local socket and connect to peer, coding over symbol_len-byte
symbols. conn_window caps total outstanding symbols; per_stream_window
caps each stream’s share.
Sourcepub fn stream_protection(&self, stream_id: u32) -> Option<Protection>
pub fn stream_protection(&self, stream_id: u32) -> Option<Protection>
The FEC policy a stream was opened with, if it exists.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
The sender’s local address.
Sourcepub fn open_stream(&mut self, stream_id: u32, protection: Protection)
pub fn open_stream(&mut self, stream_id: u32, protection: Protection)
Open a stream with the given FEC policy. Re-opening keeps the existing stream (the policy is fixed at first open).
Sourcepub fn write(&mut self, stream_id: u32, data: &[u8], fin: bool) -> Result<()>
pub fn write(&mut self, stream_id: u32, data: &[u8], fin: bool) -> Result<()>
Write data on stream_id. Full symbols are emitted immediately; a
partial tail is buffered until the next write or fin. With fin set the
stream is closed: the buffered tail goes out as the final (short) symbol
and a reliable STREAM_FIN announces its index and length.
Sourcepub fn pump(&mut self) -> Result<()>
pub fn pump(&mut self) -> Result<()>
Drain incoming NAK / ACK frames: retransmit NAK’d symbols and advance each
stream’s acked frontier (which frees the flow windows). Also resends the
STREAM_FIN of any finished-but-unacked stream on a slow cadence, so a
terminator lost while other streams are still being written still
converges (not only once the final flush begins).