diff --git a/test/java/net/Socket/asyncClose/Race.java b/test/java/net/Socket/asyncClose/Race.java index 5a9585682f11817638952c9ecbb6bfeb14ffbb7f..3a7b7affeecbab3a18126d5347ed87f03d528cb2 100644 --- a/test/java/net/Socket/asyncClose/Race.java +++ b/test/java/net/Socket/asyncClose/Race.java @@ -30,6 +30,7 @@ import java.io.InputStream; import java.net.ServerSocket; import java.net.Socket; +import java.net.ConnectException; import java.net.SocketException; import java.util.concurrent.Phaser; @@ -43,33 +44,37 @@ public class Race { final int port = ss.getLocalPort(); final Phaser phaser = new Phaser(THREADS + 1); for (int i=0; i<100; i++) { - final Socket s = new Socket("localhost", port); - s.setSoLinger(false, 0); - try (Socket sa = ss.accept()) { - sa.setSoLinger(false, 0); - final InputStream is = s.getInputStream(); - Thread[] threads = new Thread[THREADS]; - for (int j=0; j