pub struct FrameConfig {
pub data_frame_payload_size: Option<usize>,
pub control_write_timeout: Duration,
pub data_frame_write_timeout: Duration,
pub read_buffer_size: usize,
pub write_buffer_size: usize,
pub max_write_buffer_size: usize,
pub max_message_size: Option<usize>,
pub max_frame_size: Option<usize>,
}Expand description
WebSocket data frame fragmentation, read and write buffers, and receive size limits.
Fields§
§data_frame_payload_size: Option<usize>Payload size, in bytes, for outgoing data-frame fragments; the default is
32 KiB and None disables active fragmentation.
Set to at least 1024 bytes, and the write buffer limit must also accommodate the payload and frame header.
control_write_timeout: DurationMaximum time for a single Ping, Pong, or Close write and for closing the underlying sender; the default is 1,500 milliseconds.
data_frame_write_timeout: DurationThe time limit for writing a single data frame, the default is 1500 milliseconds; it is still subject to the overall message writing deadline.
read_buffer_size: usizeThe underlying WebSocket read buffer size in bytes, default 128 KiB.
write_buffer_size: usizeTarget size of the underlying WebSocket write buffer, in bytes, defaults to 128 KiB; zero is allowed.
max_write_buffer_size: usizeMaximum number of bytes for the underlying WebSocket write buffer, defaults to 4 MiB; must be larger than the target write buffer size.
max_message_size: Option<usize>The maximum number of bytes to receive a complete message, default 64 MiB; None means not to set this size limit.
max_frame_size: Option<usize>Maximum bytes in one received frame; the default is 16 MiB and None
disables this limit.
Implementations§
Source§impl FrameConfig
impl FrameConfig
Sourcepub const MIN_DATA_FRAME_PAYLOAD_SIZE: usize = 1024
pub const MIN_DATA_FRAME_PAYLOAD_SIZE: usize = 1024
Smallest supported outgoing data-frame payload fragment.
Sourcepub const DEFAULT_DATA_FRAME_PAYLOAD_SIZE: usize
pub const DEFAULT_DATA_FRAME_PAYLOAD_SIZE: usize
Default outgoing data-frame payload fragment size.