> 
> 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?
> 

you can use the peerhost function to get the adr:
$addr = $server->peerhost;
$host = gethostbyaddr($addr, AF_INET);



 


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

Reply via email to