Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Connect to a remote socketRetrieve the sockaddr for a gi ... (Berikutnya)
Low-level socket functions

Find the other end of a socket connection

Daftar Isi

  • getpeername SOCKET

    Returns the packed sockaddr address of the other end of the SOCKETconnection.

    1. use Socket;
    2. $hersockaddr = getpeername(SOCK);
    3. ($port, $iaddr) = sockaddr_in($hersockaddr);
    4. $herhostname = gethostbyaddr($iaddr, AF_INET);
    5. $herstraddr = inet_ntoa($iaddr);
 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Connect to a remote socketRetrieve the sockaddr for a gi ... (Berikutnya)