getpeername - find the other end of a socket connection

- NAME
- SYNOPSIS
- DESCRIPTION

# NAME

getpeername - find the other end of a socket connection

# SYNOPSIS

getpeername SOCKET

# DESCRIPTION

Returns the packed sockaddr address of other end of the SOCKET connection.

        use Socket;
        $hersockaddr    = getpeername(SOCK);
        ($port, $iaddr) = sockaddr_in($hersockaddr);
        $herhostname    = gethostbyaddr($iaddr, AF_INET);
        $herstraddr     = inet_ntoa($iaddr);

getpeername - find the other end of a socket connection