IO-Socket-Multicast - How to obtain the Source IP in a multicast client

Posted on Thu Feb 7 21:57:39 2008 by perldashw
How to obtain the Source IP in a multicast client

So imagine the multicast client taken directly from the IO::Socket::Multicast docs:

use IO::Socket::Multicast; my $sock = IO::Socket::Multicast->new(Proto=>'udp',LocalPort=>PORT); $sock->mcast_add(GROUP); while (1) { my $data; next unless $sock->recv($data,1024); print $data; }

How would one obtain the ip address of the machine that sent $data?

Thanks a million!

-Mike

Write a response