#! /usr/bin/perl -w
use strict;
use IO::Socket;


# *********** globals
my $msgsock; # the socket
my $portno = 53831; # birthday port
my $maxtoread = 256;
my $them;
my $msg;

#************** main
$msgsock = IO::Socket::INET->new(LocalPort => $portno, Proto => "udp")
 									or die ("couldn't bind to port:$!");

print ("waiting for message\n");
while ($them = $msgsock->recv($msg,$maxtoread))
{
 print ("message received:$msg\n");

}


__END__
127.0.0.1	localhost
127.0.1.1	main



# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


