[][src]Trait new_home_application::net::tcp_server::TcpServer

pub trait TcpServer {
    fn bind(&mut self);
fn get_tcp_stream(
        &self
    ) -> Result<(Box<dyn TcpWriter>, Box<dyn TcpReader>), Error>; }

The interface which wraps around the std::net::TcpListener and adapts the TcpReader and TcpWriter object to the std::net::* objects to simplify the usage of networking in unit tests

Required methods

fn bind(&mut self)

Binds the TcpListener to the given ip and port.

fn get_tcp_stream(
    &self
) -> Result<(Box<dyn TcpWriter>, Box<dyn TcpReader>), Error>

Accepts a client connections. Returns a TcpWriter and a TcpReader connected to the std::net::TcpStream of the connected client

Loading content...

Implementors

impl TcpServer for TcpServerImpl[src]

Loading content...