pub fn peer_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 {
            getpeername(
                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)))
        }
    }
/// Virtio socket address of the remote peer associated with this connection.
Virtio socket address of the remote peer associated with this connection.
Virtio socket address of the remote peer associated with this connection .
pub fn peer_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 {
            getpeername(
                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 peer_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 { getpeername ( 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 ) ) ) } }
Virtio socket address of the remote peer associated with this connection.
Virtio socket address of the remote peer associated with this connection .
&self
&self