Enum yamux::WindowUpdateMode
source · pub enum WindowUpdateMode {
OnReceive,
OnRead,
}
Expand description
Specifies when window update frames are sent.
Variants§
OnReceive
Send window updates as soon as a Stream
’s receive window drops to 0.
This ensures that the sender can resume sending more data as soon as possible
but a slow reader on the receiving side may be overwhelmed, i.e. it accumulates
data in its buffer which may reach its limit (see set_max_buffer_size
).
In this mode, window updates merely prevent head of line blocking but do not
effectively exercise back pressure on senders.
OnRead
Send window updates only when data is read on the receiving end.
This ensures that senders do not overwhelm receivers and keeps buffer usage low. However, depending on the protocol, there is a risk of deadlock, namely if both endpoints want to send data larger than the receivers window and they do not read before finishing their writes. Use this mode only if you are sure that this will never happen, i.e. if
- Endpoints A and B never write at the same time, or
- Endpoints A and B write at most n frames concurrently such that the sum of the frame lengths is less or equal to the available credit of A and B respectively.
Trait Implementations§
source§impl Clone for WindowUpdateMode
impl Clone for WindowUpdateMode
source§fn clone(&self) -> WindowUpdateMode
fn clone(&self) -> WindowUpdateMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WindowUpdateMode
impl Debug for WindowUpdateMode
source§impl PartialEq<WindowUpdateMode> for WindowUpdateMode
impl PartialEq<WindowUpdateMode> for WindowUpdateMode
source§fn eq(&self, other: &WindowUpdateMode) -> bool
fn eq(&self, other: &WindowUpdateMode) -> bool
self
and other
values to be equal, and is used
by ==
.