Struct nexus::tcp::TcpReactor
[−]
[src]
pub struct TcpReactor<P: TcpProtocol> { /* fields omitted */ }
A Reactor for TCP connections, handles accepting new connections and passing them to the protocol.
Methods
impl<P: TcpProtocol> TcpReactor<P>
[src]
fn new(proto: P, listener: TcpListener) -> Result<TcpReactor<P>>
Create a TcpReactor with the associated listener and default configuration.
fn with_configuration(
proto: P,
listener: TcpListener,
config: ReactorConfig
) -> Result<TcpReactor<P>>
proto: P,
listener: TcpListener,
config: ReactorConfig
) -> Result<TcpReactor<P>>
Create a TcpReactor with the associated listener and specified configuration.
fn run(&mut self) -> Result<()>
Start and run the Reactor.
fn shutdown_handle(&self) -> ShutdownHandle
Handle to shutdown the Reactor.
fn spin_once(&mut self) -> Result<()>
spin_once the Reactor for a single iteration.
This is mostly used for test purposes.