/// Register a given TCP stream in a given event loop.
Register a given TCP stream in a given event loop.
Register a given TCP stream in a given event loop .
fn register_socket<H: Handler>(
    token_id: usize, 
    stream: &TcpStream, 
    readable: bool,
    writable: bool, 
    event_loop: &mut EventLoop<H>) {
    let poll       = PollOpt::level();
    let mut events = EventSet::all();
    if !readable {
        events.remove(EventSet::readable());
    }
    if !writable {
        events.remove(EventSet::writable());
    }
    event_loop.register(stream, Token(token_id), events, poll)
        .unwrap();
}
fn register_socket < H : Handler > ( token_id : usize , stream : & TcpStream , readable : bool , writable : bool , event_loop : & mut EventLoop < H > ) { let poll = PollOpt :: level ( ) ; let mut events = EventSet :: all ( ) ; if ! readable { events . remove ( EventSet :: readable ( ) ) ; } if ! writable { events . remove ( EventSet :: writable ( ) ) ; } event_loop . register ( stream , Token ( token_id ) , events , poll ) . unwrap ( ) ; }
Register a given TCP stream in a given event loop.
Register a given TCP stream in a given event loop .
token_id
usize
stream
&TcpStream
readable
bool
writable
bool
event_loop
&mut EventLoop<H>