Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 2502669

Now terminating out of the loop in listen_port_only.t.

  • Participants
  • Parent commits 45c6381

Comments (0)

Files changed (1)

File modules/IO-Socket-INET6/t/listen_port_only.t

 my ($server,$port);
 # try to create inet6 listener on some port, w/o given
 # LocalHost (should use :: then)
+CREATE_SERVER:
 for my $i (1 .. 100)
 {
-	$port = int(rand(50000)+2000);
-	$server = IO::Socket::INET6->new(
-		LocalPort => $port,
-		Listen => 10,
-	) or next;
+    $port = int(rand(50000)+2000);
+    $server = IO::Socket::INET6->new(
+        LocalPort => $port,
+        Listen => 10,
+    );
+    if ($server)
+    {
+        last CREATE_SERVER;
+    }
 }
+
 if (!$server)
 {
     plan skip_all => "failed to create inet6 listener";
 }
 elsif ( $server->sockhost ne '::' )
 {
-	plan skip_all => "not listening on ::, maybe inet6 not available";
+    plan skip_all => "not listening on ::, maybe inet6 not available";
 }
 else
 {