Trait net2::TcpListenerExt

source ·
pub trait TcpListenerExt {
    // Required methods
    fn set_ttl(&self, ttl: u32) -> Result<()>;
    fn ttl(&self) -> Result<u32>;
    fn set_only_v6(&self, only_v6: bool) -> Result<()>;
    fn only_v6(&self) -> Result<bool>;
    fn take_error(&self) -> Result<Option<Error>>;
    fn set_nonblocking(&self, nonblocking: bool) -> Result<()>;
    fn set_linger(&self, dur: Option<Duration>) -> Result<()>;
    fn linger(&self) -> Result<Option<Duration>>;
}
Expand description

Extension methods for the standard TcpListener type in std::net.

Required Methods§

source

fn set_ttl(&self, ttl: u32) -> Result<()>

Sets the value for the IP_TTL option on this socket.

This is the same as TcpStreamExt::set_ttl.

source

fn ttl(&self) -> Result<u32>

Gets the value of the IP_TTL option for this socket.

For more information about this option, see TcpStreamExt::set_ttl.

source

fn set_only_v6(&self, only_v6: bool) -> Result<()>

Sets the value for the IPV6_V6ONLY option on this socket.

For more information about this option, see TcpStreamExt::set_only_v6.

source

fn only_v6(&self) -> Result<bool>

Gets the value of the IPV6_V6ONLY option for this socket.

For more information about this option, see TcpStreamExt::set_only_v6.

source

fn take_error(&self) -> Result<Option<Error>>

Get the value of the SO_ERROR option on this socket.

This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.

source

fn set_nonblocking(&self, nonblocking: bool) -> Result<()>

Moves this TCP listener into or out of nonblocking mode.

For more information about this option, see TcpStreamExt::set_nonblocking.

source

fn set_linger(&self, dur: Option<Duration>) -> Result<()>

Sets the linger duration of this socket by setting the SO_LINGER option

source

fn linger(&self) -> Result<Option<Duration>>

reads the linger duration for this socket by getting the SO_LINGER option

Implementations on Foreign Types§

source§

impl TcpListenerExt for TcpListener

source§

fn set_ttl(&self, ttl: u32) -> Result<()>

source§

fn ttl(&self) -> Result<u32>

source§

fn set_only_v6(&self, only_v6: bool) -> Result<()>

source§

fn only_v6(&self) -> Result<bool>

source§

fn take_error(&self) -> Result<Option<Error>>

source§

fn set_nonblocking(&self, nonblocking: bool) -> Result<()>

source§

fn set_linger(&self, dur: Option<Duration>) -> Result<()>

source§

fn linger(&self) -> Result<Option<Duration>>

Implementors§