Struct asyncio::socket_base::ReuseAddr
[−]
[src]
pub struct ReuseAddr(_);
Socket option to allow the socket to be bound to an address that is already in use.
Implements the SOL_SOCKET/SO_REUSEADDR socket option.
Examples
Setting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::ReuseAddr; let ctx = &IoContext::new().unwrap(); let soc = TcpListener::new(ctx, Tcp::v4()).unwrap(); soc.set_option(ReuseAddr::new(true)).unwrap();
Getting the option:
use asyncio::*; use asyncio::ip::*; use asyncio::socket_base::ReuseAddr; let ctx = &IoContext::new().unwrap(); let soc = TcpListener::new(ctx, Tcp::v4()).unwrap(); let opt: ReuseAddr = soc.get_option().unwrap(); let is_set: bool = opt.get();
Methods
impl ReuseAddr
[src]
Trait Implementations
impl Default for ReuseAddr
[src]
impl Clone for ReuseAddr
[src]
fn clone(&self) -> ReuseAddr
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