pub trait VirtualTcpListener: Debug + Send + Sync + 'static {
    // Required methods
    fn try_accept(
        &mut self
    ) -> Option<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>;
    fn poll_accept(
        &mut self,
        cx: &mut Context<'_>
    ) -> Poll<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>;
    fn poll_accept_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>;
    fn addr_local(&self) -> Result<SocketAddr>;
    fn set_ttl(&mut self, ttl: u8) -> Result<()>;
    fn ttl(&self) -> Result<u8>;
}

Required Methods§

source

fn try_accept( &mut self ) -> Option<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>

Tries to accept a new connection

source

fn poll_accept( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>

Polls the socket for new connections

source

fn poll_accept_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>

Polls the socket for when there is data to be received

source

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

Returns the local address of this TCP listener

source

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

Sets how many network hops the packets are permitted for new connections

source

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

Returns the maximum number of network hops before packets are dropped

Implementors§