pub fn take_error(&self) -> Result<Option<Error>> {
        let mut error: i32 = 0;
        let mut error_len: socklen_t = 0;
        if unsafe {
            getsockopt(
                self.socket,
                SOL_SOCKET,
                SO_ERROR,
                &mut error as *mut _ as *mut c_void,
                &mut error_len,
            )
        } < 0
        {
            Err(Error::last_os_error())
        } else {
            Ok(if error == 0 {
                None
            } else {
                Some(Error::from_raw_os_error(error))
            })
        }
    }
/// Retrieve the latest error associated with the underlying socket.
Retrieve the latest error associated with the underlying socket.
Retrieve the latest error associated with the underlying socket .
pub fn take_error(&self) -> Result<Option<Error>> {
        let mut error: i32 = 0;
        let mut error_len: socklen_t = 0;
        if unsafe {
            getsockopt(
                self.socket,
                SOL_SOCKET,
                SO_ERROR,
                &mut error as *mut _ as *mut c_void,
                &mut error_len,
            )
        } < 0
        {
            Err(Error::last_os_error())
        } else {
            Ok(if error == 0 {
                None
            } else {
                Some(Error::from_raw_os_error(error))
            })
        }
    }
pub fn take_error ( & self ) -> Result < Option < Error > > { let mut error : i32 = 0 ; let mut error_len : socklen_t = 0 ; if unsafe { getsockopt ( self . socket , SOL_SOCKET , SO_ERROR , & mut error as * mut _ as * mut c_void , & mut error_len , ) } < 0 { Err ( Error :: last_os_error ( ) ) } else { Ok ( if error == 0 { None } else { Some ( Error :: from_raw_os_error ( error ) ) } ) } }
Retrieve the latest error associated with the underlying socket.
Retrieve the latest error associated with the underlying socket .
&self
&self