Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
doc
/
perl-IO-Socket-Multicast
/
examples
Upload
4 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
client.pl
370 B
-rw-r--r--
2010-01-29 11:38:26
Edit
Del
server.pl
359 B
-rw-r--r--
2010-01-29 11:38:26
Edit
Del
Editing: client.pl
(370 B)
Path: /usr/share/doc/perl-IO-Socket-Multicast/examples/client.pl
Back
#!/usr/bin/perl use strict; use lib '../blib/lib','../blib/arch'; use IO::Socket::Multicast; use constant GROUP => '226.1.1.2'; use constant PORT => '2000'; my $sock = IO::Socket::Multicast->new(LocalPort=>PORT,ReuseAddr=>1); $sock->mcast_add(GROUP) || die "Couldn't set group: $!\n"; while (1) { my $data; next unless $sock->recv($data,1024); print $data; }