Function nix::sys::socket::getpeername

pub fn getpeername(fd: RawFd) -> Result<SockAddr>
Documentation

Get the address of the peer connected to the socket fd.

Further reading