Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / t / lib / io_sock.t
index e236f5f..056d131 100755 (executable)
@@ -134,7 +134,7 @@ if($pid = fork()) {
     }
 
     # some machines seem to suffer from a race condition here
-    sleep(1);
+    sleep(2);
 
     $sock = IO::Socket::INET->new("127.0.0.1:$port");
     if ($sock) {
@@ -148,7 +148,7 @@ if($pid = fork()) {
     }
 
     # some machines seem to suffer from a race condition here
-#    sleep(1);
+    sleep(1);
 
     $sock = IO::Socket->new(Domain => AF_INET,
                             PeerAddr => "localhost:$port");
@@ -169,20 +169,24 @@ $server = IO::Socket->new(Domain => AF_INET,
                           LocalAddr => 'localhost');
 $port = $server->sockport;
 
-if ($pid = fork()) {
-    my $buf;
-    $server->recv($buf, 100);
-    print $buf;
-} elsif (defined($pid)) {
-    #child
-    $sock = IO::Socket::INET->new(Proto => 'udp',
-                                  PeerAddr => "localhost:$port");
-    $sock->send("ok 12\n");
-    sleep(1);
-    $sock->send("ok 12\n");  # send another one to be sure
-    exit;
+if ($^O eq 'mpeix') {
+    print("ok 12 # skipped\n")
 } else {
-    die;
+    if ($pid = fork()) {
+        my $buf;
+        $server->recv($buf, 100);
+        print $buf;
+    } elsif (defined($pid)) {
+        #child
+        $sock = IO::Socket::INET->new(Proto => 'udp',
+                                      PeerAddr => "localhost:$port");
+        $sock->send("ok 12\n");
+        sleep(1);
+        $sock->send("ok 12\n");  # send another one to be sure
+        exit;
+    } else {
+        die;
+    }
 }
 
 print "not " unless $server->blocking;