mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
add files to go with previous commit
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@617 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
12
scripts/multicast/recv.pl
Normal file
12
scripts/multicast/recv.pl
Normal file
@@ -0,0 +1,12 @@
|
||||
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;
|
||||
}
|
15
scripts/multicast/send.pl
Executable file
15
scripts/multicast/send.pl
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/local/bin/perl
|
||||
use IO::Socket::INET;
|
||||
|
||||
my ($ip, $port, $file) = @ARGV;
|
||||
|
||||
$ip and $port or die "Usage $0: <ip> <port>\n";
|
||||
|
||||
$socket = new IO::Socket::INET->new( PeerPort => $port,
|
||||
Proto => 'udp',
|
||||
PeerAddr => $ip);
|
||||
|
||||
my $buf = `cat $file`;
|
||||
|
||||
$socket->send("$buf\n");
|
||||
|
Reference in New Issue
Block a user