freeswitch/scripts/perl/multicast/recv.pl
Anthony Minessale 7095887bad update
2010-04-07 01:44:56 -05:00

13 lines
310 B
Perl

use IO::Socket::Multicast;
my ($ip,$port) = @ARGV;
$ip and $port or die "Usage $0: <ip> <port>\n";
# create a new UDP socket and add a multicast group
my $socket = IO::Socket::Multicast->new( LocalPort => $port, ReuseAddr => 1 );
$socket->mcast_add($ip);
while($socket->recv($data,1024)) {
print $data;
}