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})) {
21 $port = 4002 + int(rand 0xff);
22 print "# using port $port.\n";
29 $listen = IO::Socket::INET->new(Listen => 2,
39 $sock = $listen->accept();
43 print $sock->getline();
52 } elsif(defined $pid) {
54 # Wait for a small pause, so that we can ensure the listen socket is setup
55 # the parent will awake us with a SIGALRM
59 $sock = IO::Socket::INET->new(PeerPort => $port,
61 PeerAddr => 'localhost'
66 print $sock->getline();