pub fn local_addr(&self) -> Result<SockAddr> {
        let mut vsock_addr = sockaddr_vm {
            svm_family: AF_VSOCK as sa_family_t,
            svm_reserved1: 0,
            svm_port: 0,
            svm_cid: 0,
            svm_zero: [0u8; 4],
        };
        let mut vsock_addr_len = size_of::<sockaddr_vm>() as socklen_t;
        if unsafe {
            getsockname(
                self.socket,
                &mut vsock_addr as *mut _ as *mut sockaddr,
                &mut vsock_addr_len,
            )
        } < 0
        {
            Err(Error::last_os_error())
        } else {
            Ok(SockAddr::Vsock(VsockAddr(vsock_addr)))
        }
    }
/// The local socket address of the listener.
The local socket address of the listener.
The local socket address of the listener .
pub fn local_addr(&self) -> Result<SockAddr> {
        let mut vsock_addr = sockaddr_vm {
            svm_family: AF_VSOCK as sa_family_t,
            svm_reserved1: 0,
            svm_port: 0,
            svm_cid: 0,
            svm_zero: [0u8; 4],
        };
        let mut vsock_addr_len = size_of::<sockaddr_vm>() as socklen_t;
        if unsafe {
            getsockname(
                self.socket,
                &mut vsock_addr as *mut _ as *mut sockaddr,
                &mut vsock_addr_len,
            )
        } < 0
        {
            Err(Error::last_os_error())
        } else {
            Ok(SockAddr::Vsock(VsockAddr(vsock_addr)))
        }
    }
pub fn local_addr ( & self ) -> Result < SockAddr > { let mut vsock_addr = sockaddr_vm { svm_family : AF_VSOCK as sa_family_t , svm_reserved1 : 0 , svm_port : 0 , svm_cid : 0 , svm_zero : [ 0u8 ; 4 ] , } ; let mut vsock_addr_len = size_of :: < sockaddr_vm > ( ) as socklen_t ; if unsafe { getsockname ( self . socket , & mut vsock_addr as * mut _ as * mut sockaddr , & mut vsock_addr_len , ) } < 0 { Err ( Error :: last_os_error ( ) ) } else { Ok ( SockAddr :: Vsock ( VsockAddr ( vsock_addr ) ) ) } }
The local socket address of the listener.
The local socket address of the listener .
&self
&self