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§
Sourcefn addr_local(&self) -> Result<SocketAddr>
fn addr_local(&self) -> Result<SocketAddr>
Returns the local address of this bound TCP socket.
Sourcefn listen(&mut self) -> Result<Box<dyn VirtualTcpListener + Sync>>
fn listen(&mut self) -> Result<Box<dyn VirtualTcpListener + Sync>>
Places the socket into listening mode.
Sourcefn connect(
&mut self,
peer: SocketAddr,
) -> Result<Box<dyn VirtualTcpSocket + Sync>>
fn connect( &mut self, peer: SocketAddr, ) -> Result<Box<dyn VirtualTcpSocket + Sync>>
Initiates a TCP connection using the already-bound local address.