5 @INC = '../lib' if -d '../lib';
6 require Config; import Config;
7 if ( ($Config{'extensions'} !~ /\bSocket\b/ ||
8 $Config{'extensions'} !~ /\bIO\b/) &&
9 !(($^O eq 'VMS') && $Config{d_socket})) {
20 $port = 4002 + int(rand(time) & 0xff);
26 $listen = IO::Socket::INET->new(Listen => 2,
36 $sock = $listen->accept();
40 print $sock->getline();
49 } elsif(defined $pid) {
51 # Wait for a small pause, so that we can ensure the listen socket is setup
52 # the parent will awake us with a SIGALRM
57 $sock = IO::Socket::INET->new(PeerPort => $port,
59 PeerAddr => 'localhost'
64 print $sock->getline();