VirtualTcpBoundSocket

Trait VirtualTcpBoundSocket 

Source
pub trait VirtualTcpBoundSocket:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn addr_local(&self) -> Result<SocketAddr>;
    fn listen(&mut self) -> Result<Box<dyn VirtualTcpListener + Sync>>;
    fn connect(
        &mut self,
        peer: SocketAddr,
    ) -> Result<Box<dyn VirtualTcpSocket + Sync>>;
    fn set_ttl(&mut self, ttl: u32) -> Result<()>;
    fn ttl(&self) -> Result<u32>;
}

Required Methods§

Source

fn addr_local(&self) -> Result<SocketAddr>

Returns the local address of this bound TCP socket.

Source

fn listen(&mut self) -> Result<Box<dyn VirtualTcpListener + Sync>>

Places the socket into listening mode.

Source

fn connect( &mut self, peer: SocketAddr, ) -> Result<Box<dyn VirtualTcpSocket + Sync>>

Initiates a TCP connection using the already-bound local address.

Source

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

Sets how many network hops the packets are permitted for this socket.

Source

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

Returns the maximum number of network hops before packets are dropped.

Implementors§