in reply to Re: Re: udp broadcast: doesn't work in Linux
in thread udp broadcast: doesn't work in Linux
croak 'send: Cannot determine peer address'
unless($peer);
So getpeername($sock) returning undef is what I expected would happen, I just didn't explain that well enough. It should return the address of the peer at the remote end of the socket.my ($port, $addr) = unpack_sockaddr_in(getpeername($sock)); my $host = gethostbyaddr($addr, AF_INET); print "Host:\t$host\n"; print "Port:\t$port\n";
|
|---|