Find Multicast sender IP

21/06/2010 - 10:12 von Andre | Report spam
Hi all

I'm writing a small Client/Server tool. Sender send's data to client
via multcast and client can send orders to sender via unicast. So far
everything is working fine.

My idea is not to configure server's IP address statically on client
side but to find out multicast sender IP. Multicast is sent all the
time and if i could find out sender IP i would have some kind of
automatic configuration.

I'm using IO::Socket::Multicast and start listening to multicast this
way

$sock = IO::Socket::Multicast->new(LocalPort=>64001);
$sock->mcast_add('239.1.1.1') || die "Couldn't set group: $!";

Hope someone can help me.

Thanks in advance

Andre
 

Lesen sie die antworten

#1 Peter J. Holzer
22/06/2010 - 14:10 | Warnen spam
On 2010-06-21 08:12, Andre wrote:
My idea is not to configure server's IP address statically on client
side but to find out multicast sender IP. Multicast is sent all the
time and if i could find out sender IP i would have some kind of
automatic configuration.



perldoc -f recv:

Returns the address of the sender if SOCKET's protocol
supports this;

hp

Ähnliche fragen