pub struct ListenOptions {
pub backlog: i32,
pub reuse_port: bool,
pub nodelay: bool,
pub v6_only: Option<bool>,
pub recv_buffer: Option<usize>,
pub send_buffer: Option<usize>,
pub defer_accept: Option<u32>,
}Expand description
Options for Socket::tcp_listen.
Fields§
§backlog: i32Length of the kernel accept queue. The default is default_backlog: the system’s
maximum (net.core.somaxconn on Linux, capped at 65535; SOMAXCONN on Windows), so a
burst of connections, or 100k idle ones arriving together, isn’t dropped.
reuse_port: boolSO_REUSEPORT (Linux, BSD): several sockets may bind the same address and the kernel
spreads connections over them. Ignored on Windows.
nodelay: boolSet TCP_NODELAY on the listener (Linux and Windows hand it down to accepted sockets).
v6_only: Option<bool>IPV6_V6ONLY for IPv6 addresses; None leaves the OS default.
recv_buffer: Option<usize>SO_RCVBUF, inherited by accepted sockets.
send_buffer: Option<usize>SO_SNDBUF, inherited by accepted sockets.
defer_accept: Option<u32>TCP_DEFER_ACCEPT (Linux) in seconds: the kernel hands over a connection only once its
first data has arrived (or this long after the handshake), so accepting and reading the
first request take one turn. Only for protocols where the client speaks first (HTTP,
TLS). None (the default here) leaves it off; ignored on other systems.
Trait Implementations§
Source§impl Clone for ListenOptions
impl Clone for ListenOptions
Source§fn clone(&self) -> ListenOptions
fn clone(&self) -> ListenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more