pub fn register_socket(&mut self,
                           socket: &AsRawSocket,
                           poll: &Poll,
                           token: Token,
                           events: Ready,
                           opts: PollOpt,
                           registration: &Mutex<Option<poll::Registration>>)
                           -> io::Result<()> {
        trace!("register {:?} {:?}", token, events);
        unsafe {
            try!(self.binding.register_socket(socket, token, poll));
        }

        // To keep the same semantics as epoll, if I/O objects are interested in
        // being readable then they're also interested in listening for hup
        let events = if events.is_readable() {
            events | Ready::hup()
        }  else {
            events
        };
        let (r, s) = poll::Registration::new(poll, token, events, opts);
        self.readiness = Some(s);
        *registration.lock().unwrap() = Some(r);
        Ok(())
    }
/// Implementation of the `Evented::register` function essentially.
///
/// Returns an error if we're already registered with another event loop,
/// and otherwise just reassociates ourselves with the event loop to
/// possible change tokens.
Implementation of the `Evented::register` function essentially.
Returns an error if we're already registered with another event loop,
and otherwise just reassociates ourselves with the event loop to
possible change tokens.
Implementation of the ` Evented :: register ` function essentially . Returns an error if we ' re already registered with another event loop and otherwise just reassociates ourselves with the event loop to possible change tokens .
pub fn register_socket(&mut self,
                           socket: &AsRawSocket,
                           poll: &Poll,
                           token: Token,
                           events: Ready,
                           opts: PollOpt,
                           registration: &Mutex<Option<poll::Registration>>)
                           -> io::Result<()> {
        trace!("register {:?} {:?}", token, events);
        unsafe {
            try!(self.binding.register_socket(socket, token, poll));
        }
        // To keep the same semantics as epoll, if I/O objects are interested in
        // being readable then they're also interested in listening for hup
        let events = if events.is_readable() {
            events | Ready::hup()
        }  else {
            events
        };
        let (r, s) = poll::Registration::new(poll, token, events, opts);
        self.readiness = Some(s);
        *registration.lock().unwrap() = Some(r);
        Ok(())
    }
pub fn register_socket ( & mut self , socket : & AsRawSocket , poll : & Poll , token : Token , events : Ready , opts : PollOpt , registration : & Mutex < Option < poll :: Registration > > ) -> io :: Result < ( ) > { trace ! ( " " token events ) ; unsafe { try ! ( self binding register_socket ( socket token poll ) ) ; } // To keep the same semantics as epoll, if I/O objects are interested in // being readable then they're also interested in listening for hup let events = if events . is_readable ( ) { events | Ready :: hup ( ) } else { events } ; let ( r , s ) = poll :: Registration :: new ( poll , token , events , opts ) ; self . readiness = Some ( s ) ; * registration . lock ( ) . unwrap ( ) = Some ( r ) ; Ok ( ( ) ) }
Implementation of the `Evented::register` function essentially.
Implementation of the ` Evented :: register ` function essentially .
&mut self
socket
&AsRawSocket
poll
&Poll
token
Token
events
Ready
opts
PollOpt
registration
&Mutex<Option<poll::Registration>>