/// Get the value of the `SO_ERROR` option on this socket.
///
/// This will retrieve the stored error in the underlying socket, clearing
/// the field in the process. This can be useful for checking errors between
/// calls.
Get the value of the `SO_ERROR` option on this socket.
This will retrieve the stored error in the underlying socket, clearing
the field in the process. This can be useful for checking errors between
calls.
Get the value of the ` SO_ERROR ` option on this socket . This will retrieve the stored error in the underlying socket clearing the field in the process . This can be useful for checking errors between calls .
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
        self.getsockopt::<c_int>(libc::SOL_SOCKET, libc::SO_ERROR)
            .map(|errno| {
                if errno == 0 {
                    None
                } else {
                    Some(io::Error::from_raw_os_error(errno))
                }
            })
    }
pub fn take_error ( & self ) -> io :: Result < Option < io :: Error > > { self . getsockopt :: < c_int > ( libc :: SOL_SOCKET , libc :: SO_ERROR ) . map ( | errno | { if errno == 0 { None } else { Some ( io :: Error :: from_raw_os_error ( errno ) ) } } ) }
Get the value of the `SO_ERROR` option on this socket.
Get the value of the ` SO_ERROR ` option on this socket .
&self