wasmer_vnet

Trait VirtualTcpListener

Source
pub trait VirtualTcpListener:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn accept(&self) -> Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>;
    fn accept_timeout(
        &self,
        timeout: Duration,
    ) -> Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>;
    fn set_timeout(&mut self, timeout: Option<Duration>) -> Result<()>;
    fn timeout(&self) -> Result<Option<Duration>>;
    fn addr_local(&self) -> Result<SocketAddr>;
    fn set_ttl(&mut self, ttl: u8) -> Result<()>;
    fn ttl(&self) -> Result<u8>;
}

Required Methods§

Source

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

Accepts an connection attempt that was made to this listener

Source

fn accept_timeout( &self, timeout: Duration, ) -> Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>

Accepts an connection attempt that was made to this listener (or times out)

Source

fn set_timeout(&mut self, timeout: Option<Duration>) -> Result<()>

Sets the accept timeout

Source

fn timeout(&self) -> Result<Option<Duration>>

Gets the accept timeout

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§