test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SelectorTest.java
branchhttp-client-branch
changeset 56265 ec34ae013fbe
parent 56233 1753108d07b9
child 56451 9585061fdb04
--- a/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SelectorTest.java	Thu Mar 08 17:41:52 2018 +0000
+++ b/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SelectorTest.java	Thu Mar 08 17:42:16 2018 +0000
@@ -83,7 +83,7 @@
 
         try (ServerSocket server = new ServerSocket()) {
             server.setReuseAddress(false);
-            server.bind(new InetSocketAddress(0));
+            server.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
             int port = server.getLocalPort();
 
             out.println("Listening on port " + server.getLocalPort());
@@ -148,7 +148,7 @@
     }
 
     static RawChannel getARawChannel(int port) throws Exception {
-        URI uri = URI.create("http://127.0.0.1:" + port + "/");
+        URI uri = URI.create("http://localhost:" + port + "/");
         out.println("client connecting to " + uri.toString());
         HttpRequest req = HttpRequest.newBuilder(uri).build();
         // Otherwise HttpClient will think this is an ordinary connection and