Struct asyncio::socket_base::KeepAlive
[−]
[src]
pub struct KeepAlive(_);
Socket option to send keep-alives.
Implements the SOL_SOKCET/SO_KEEPALIVE socket option.
Examples
Setting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::KeepAlive; let ctx = &IoContext::new().unwrap(); let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap(); soc.set_option(KeepAlive::new(true)).unwrap();
Getting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::KeepAlive; let ctx = &IoContext::new().unwrap(); let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap(); let opt: KeepAlive = soc.get_option().unwrap(); let is_set: bool = opt.get();
Methods
impl KeepAlive
[src]
Trait Implementations
impl Default for KeepAlive
[src]
impl Clone for KeepAlive
[src]
fn clone(&self) -> KeepAlive
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