pub(crate) fn deregister(&mut self, socket: Socket) -> io::Result<()> {
        // Remove this socket from our bookkeeping. If we recognize it, also
        // remove it from the underlying poller.
        if self.sockets.remove(&socket).is_some() {
            self.bad_sockets.remove(&socket);

            // There's a good chance that the socket has already been closed.
            // Depending on the poller implementation, it may have already
            // forgotten about this socket (e.g. epoll). Therefore if we get an
            // error back complaining that the socket is invalid, we can safely
            // ignore it.
            if let Err(e) = self.poller.delete(socket) {
                if !is_bad_socket_error(&e) && e.kind() != io::ErrorKind::PermissionDenied {
                    return Err(e);
                }
            }
        }

        Ok(())
    }
/// Remove a socket from the selector and stop receiving events for it.
Remove a socket from the selector and stop receiving events for it.
Remove a socket from the selector and stop receiving events for it .
pub(crate) fn deregister(&mut self, socket: Socket) -> io::Result<()> {
        // Remove this socket from our bookkeeping. If we recognize it, also
        // remove it from the underlying poller.
        if self.sockets.remove(&socket).is_some() {
            self.bad_sockets.remove(&socket);
            // There's a good chance that the socket has already been closed.
            // Depending on the poller implementation, it may have already
            // forgotten about this socket (e.g. epoll). Therefore if we get an
            // error back complaining that the socket is invalid, we can safely
            // ignore it.
            if let Err(e) = self.poller.delete(socket) {
                if !is_bad_socket_error(&e) && e.kind() != io::ErrorKind::PermissionDenied {
                    return Err(e);
                }
            }
        }
        Ok(())
    }
pub ( crate ) fn deregister ( & mut self , socket : Socket ) -> io :: Result < ( ) > { // Remove this socket from our bookkeeping. If we recognize it, also // remove it from the underlying poller. if self . sockets . remove ( & socket ) . is_some ( ) { self . bad_sockets . remove ( & socket ) ; // There's a good chance that the socket has already been closed. // Depending on the poller implementation, it may have already // forgotten about this socket (e.g. epoll). Therefore if we get an // error back complaining that the socket is invalid, we can safely // ignore it. if let Err ( e ) = self . poller . delete ( socket ) { if ! is_bad_socket_error ( & e ) && e . kind ( ) != io :: ErrorKind :: PermissionDenied { return Err ( e ) ; } } } Ok ( ( ) ) }
Remove a socket from the selector and stop receiving events for it.
Remove a socket from the selector and stop receiving events for it .
&mut self
socket
Socket