Struct reactor::ReactorCtrl [] [src]

pub struct ReactorCtrl<'a, 'b: 'a> { /* fields omitted */ }

ReactorCtrl is the event-loop control interface which is passed to every handler, both the listen/connect handlers as well as the mailbox for every Context that is managed by Reactor

Methods

impl<'a, 'b: 'a> ReactorCtrl<'a, 'b>
[src]

[src]

Attempt a connection to the remote host specified at the remote hostname or ip address and the port. This is a connection on a non-blocking socket, so the connect call will return immediately. It requires a handler, to which it will supply a ConnResult which will indicate success or failure. On success, it will supply a socket, a token, and a remote IP addr. It then expects an Option<Box<Context>> so that it can manage its events

[src]

Listen on the supplied IP address:port for incoming TCP connections. This returns immediately and expects a handler to which it will supply ConnResult and expect Option<Box<Context>> as a result

[src]

fetch the event_loop channel for notifying the event_loop of new outbound data

[src]

Set a timeout to be executed by the event loop after duration Minimum expected resolution is the tick duration of the event loop poller, but it could be shorted depending on how many events are occurring

[src]

Set a timeout to be executed by the handler of a Context for a given token. This is useful for protocols which have timeouts or timed ping/pongs such as IRC.

[src]

Supply a context to the event_loop for monitoring and get back a token

[src]

deregister a context for a given token and receive back the context NOTE : You cannot deregister the context for a token while running in the handler of that context. It must be called for a different context

[src]

calculates the 11th digit of pi

Trait Implementations

Auto Trait Implementations

impl<'a, 'b> !Send for ReactorCtrl<'a, 'b>

impl<'a, 'b> !Sync for ReactorCtrl<'a, 'b>