NAME
getsockname - retrieve the sockaddr for a given socket
SYNOPSIS
getsockname
SOCKET
DESCRIPTION
Returns the packed sockaddr address of this end of the
SOCKET
connection.
use Socket; $mysockaddr = getsockname(SOCK); ($port, $myaddr) = unpack_sockaddr_in($mysockaddr);