pub struct IoConfig { /* private fields */ }Expand description
Base io configuration
Implementations§
Source§impl IoConfig
impl IoConfig
Sourcepub fn connect_timeout(&self) -> Millis
pub fn connect_timeout(&self) -> Millis
Get connect timeout
Sourcepub fn keepalive_timeout(&self) -> Seconds
pub fn keepalive_timeout(&self) -> Seconds
Get keep-alive timeout
Sourcepub fn disconnect_timeout(&self) -> Seconds
pub fn disconnect_timeout(&self) -> Seconds
Get disconnect timeout
Sourcepub fn frame_read_rate(&self) -> Option<&FrameReadRate>
pub fn frame_read_rate(&self) -> Option<&FrameReadRate>
Get frame read params
Sourcepub fn set_connect_timeout<T: Into<Millis>>(self, timeout: T) -> Self
pub fn set_connect_timeout<T: Into<Millis>>(self, timeout: T) -> Self
Set connect timeout in seconds.
To disable timeout set value to 0.
By default connect timeout is disabled.
Sourcepub fn set_keepalive_timeout<T: Into<Seconds>>(self, timeout: T) -> Self
pub fn set_keepalive_timeout<T: Into<Seconds>>(self, timeout: T) -> Self
Set keep-alive timeout in seconds.
To disable timeout set value to 0.
By default keep-alive timeout is disabled.
Sourcepub fn set_disconnect_timeout<T: Into<Seconds>>(self, timeout: T) -> Self
pub fn set_disconnect_timeout<T: Into<Seconds>>(self, timeout: T) -> Self
Set connection disconnect timeout.
Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.
To disable timeout set value to 0.
By default disconnect timeout is set to 1 seconds.
Sourcepub fn set_frame_read_rate(
self,
timeout: Seconds,
max_timeout: Seconds,
rate: u32,
) -> Self
pub fn set_frame_read_rate( self, timeout: Seconds, max_timeout: Seconds, rate: u32, ) -> Self
Set read rate parameters for single frame.
Set read timeout, max timeout and rate for reading payload. If the client
sends rate amount of data within timeout period of time, extend timeout by timeout seconds.
But no more than max_timeout timeout.
By default frame read rate is disabled.
Sourcepub fn set_read_buf(
self,
high_watermark: usize,
low_watermark: usize,
cache_size: usize,
) -> Self
pub fn set_read_buf( self, high_watermark: usize, low_watermark: usize, cache_size: usize, ) -> Self
Set read buffer parameters.
By default high watermark is set to 16Kb, low watermark 1kb.
Sourcepub fn set_write_buf(
self,
high_watermark: usize,
low_watermark: usize,
cache_size: usize,
) -> Self
pub fn set_write_buf( self, high_watermark: usize, low_watermark: usize, cache_size: usize, ) -> Self
Set write buffer parameters.
By default high watermark is set to 16Kb, low watermark 1kb.