changeset 360:1846fe42b40b

Always use proper loopback address.
author shade
date Wed, 22 Jan 2014 04:21:15 +0400
parents 94b4749f5bc1
children 77ac1de4a238
files jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java	Tue Jan 21 13:40:21 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java	Wed Jan 22 04:21:15 2014 +0400
@@ -149,7 +149,7 @@
         private final ServerSocket server;
 
         public Acceptor() throws IOException {
-            server = new ServerSocket(0);
+            server = new ServerSocket(0, 50, InetAddress.getLoopbackAddress());
         }
 
         @Override
@@ -173,11 +173,7 @@
         }
 
         public String getHost() {
-            try {
-                return InetAddress.getLocalHost().getHostAddress();
-            } catch (UnknownHostException e) {
-                throw new IllegalStateException("Unable to resolve local host", e);
-            }
+            return InetAddress.getLoopbackAddress().getHostAddress();
         }
 
         public int getPort() {