Struct asyncio::socket_base::Linger
[−]
[src]
pub struct Linger(_);
Socket option to specify whether the socket lingers on close if unsent data is present.
Implements the SOL_SOCKET/SO_LINGER socket option.
Examples
Setting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::Linger; let ctx = &IoContext::new().unwrap(); let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap(); soc.set_option(Linger::new(Some(30))).unwrap();
Getting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::Linger; let ctx = &IoContext::new().unwrap(); let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap(); let opt: Linger = soc.get_option().unwrap(); let is_set: Option<u16> = opt.get();
Methods
impl Linger
[src]
Trait Implementations
impl Clone for Linger
[src]
fn clone(&self) -> Linger
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more