use IO::Socket;
-$port = 4002 + int(rand(time) & 0xff);
+srand(time);
+$port = 4002 + int(rand 0xff);
+print "# using port $port.\n";
+$SIG{ALRM} = sub {};
$pid = fork();
# Wait for a small pause, so that we can ensure the listen socket is setup
# the parent will awake us with a SIGALRM
- $SIG{ALRM} = sub {};
sleep(10);
$sock = IO::Socket::INET->new(PeerPort => $port,