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]

Returns the "default value" for a type. Read more

impl Clone for KeepAlive
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<P: Protocol> SocketOption<P> for KeepAlive
[src]

impl<P: Protocol> GetSocketOption<P> for KeepAlive
[src]

impl<P: Protocol> SetSocketOption<P> for KeepAlive
[src]