pub struct TcpSettings { /* private fields */ }Expand description
Settings for a TCP stream.
Implementations§
Source§impl TcpSettings
impl TcpSettings
Sourcepub fn keepalive(&self) -> Option<&TcpKeepalive>
pub fn keepalive(&self) -> Option<&TcpKeepalive>
Returns parameters configuring TCP keepalive probes for this socket.
Sourcepub fn user_timeout(&self) -> Option<Duration>
pub fn user_timeout(&self) -> Option<Duration>
Returns the value of the TCP_USER_TIMEOUT option on this socket.
Sourcepub fn set_nodelay(self, nodelay: bool) -> Self
pub fn set_nodelay(self, nodelay: bool) -> Self
Sets the value of the TCP_NODELAY option on this socket.
Sourcepub fn set_keepalive(self, keepalive: TcpKeepalive) -> Self
pub fn set_keepalive(self, keepalive: TcpKeepalive) -> Self
Set parameters configuring TCP keepalive probes for this socket.
Default values are system-specific
Sourcepub fn set_linger_time(self, linger: Duration) -> Self
pub fn set_linger_time(self, linger: Duration) -> Self
Set the SO_LINGER time on this socket.
By default, lingering is disabled and sockets will remain in the background
after being closed. Setting linger to Duration::ZERO will disable lingering
and cause sockets to no longer wait in the TIME-WAIT state (at the cost of causing
unusual behavior if connecting to non-local-hosts where packets may be ordered).
Setting linger to a non-zero value will cause close/shutdown to wait for
reordered packets. This option may not do anything depending on your operating
system and its configuration; please consult your friendly neighborhood netadmin.
For more information, see the socket(7) man page.
Sourcepub fn set_user_timeout(self, user_timeout: Duration) -> Self
pub fn set_user_timeout(self, user_timeout: Duration) -> Self
Set the value of the TCP_USER_TIMEOUT option on this socket.
Trait Implementations§
Source§impl Clone for TcpSettings
impl Clone for TcpSettings
Source§fn clone(&self) -> TcpSettings
fn clone(&self) -> TcpSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more