getpeername

getpeername SOCKET

Returns the packed sockaddr address of the 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);
doc_perl
2016-12-06 03:20:10
Comments
Leave a Comment

Please login to continue.