Hello,
I have developed an UDP server and I need to know the ip address of the
remote peer. This is the code:

use IO::Socket;

$server_port = 514;

$server = IO::Socket::INET -> new(LocalPort => $server_port, Proto => "udp")
or die "Couldn't be a udp server on port $server_port : [EMAIL PROTECTED]";

while ($him = $server ->recv($datagram, 1024)) {

                        ($portno, $ipaddr) = sockaddr_in($him);
                        $hostinfo = gethostbyaddr($ipaddr, AF_INET);
                         print "Client:$hostinfo  $datagram\n";
}

It doesn't work... I need to print te ip address of the remote peer. Can
anybody help me?

Regards,

Ruben

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to