Trait hyper::net::NetworkAcceptor [-]  [+] [src]

pub trait NetworkAcceptor: Clone + Send {
    type Stream: NetworkStream + Send + Clone;

    fn accept(&mut self) -> IoResult<Stream>;
    fn socket_name(&self) -> IoResult<SocketAddr>;
    fn close(&mut self) -> IoResult<()>;

    fn incoming(&mut self) -> NetworkConnections<Self> { ... }
}

An abstraction to receive NetworkStreams.

Associated Types

type Stream: NetworkStream + Send + Clone

Required Methods

fn accept(&mut self) -> IoResult<Stream>

Returns an iterator of streams.

fn socket_name(&self) -> IoResult<SocketAddr>

Get the address this Listener ended up listening on.

fn close(&mut self) -> IoResult<()>

Closes the Acceptor, so no more incoming connections will be handled.

Provided Methods

fn incoming(&mut self) -> NetworkConnections<Self>

Returns an iterator over incoming connections.

Implementors