4 unless(grep /blib/, @INC) {
6 @INC = '../lib' if -d '../lib';
13 if(-d "lib" && -f "TEST") {
14 if ( ($Config{'extensions'} !~ /\bSocket\b/ ||
15 $Config{'extensions'} !~ /\bIO\b/ ||
17 !(($^O eq 'VMS') && $Config{d_socket})) {
28 use IO::Socket qw(AF_INET SOCK_DGRAM INADDR_ANY);
30 # This can fail if localhost is undefined or the
31 # special 'loopback' address 127.0.0.1 is not configured
32 # on your system. (/etc/rc.config.d/netconfig on HP-UX.)
33 # As a shortcut (not recommended) you could change 'localhost'
34 # here to be the name of this machine eg 'myhost.mycompany.com'.
36 $udpa = IO::Socket::INET->new(Proto => 'udp', LocalAddr => 'localhost')
37 or die "$! (maybe your system does not have the 'localhost' address defined)";
38 $udpb = IO::Socket::INET->new(Proto => 'udp', LocalAddr => 'localhost')
39 or die "$! (maybe your system does not have the 'localhost' address defined)";
43 $udpa->send("ok 2\n",0,$udpb->sockname);
44 $udpb->recv($buf="",5);
46 $udpb->send("ok 3\n");
47 $udpa->recv($buf="",5);