You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/04/19 19:46:41 UTC

incubator-geode git commit: Always invoke setReuseAddress(true) regardless of OS.

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1233 166320ef9 -> f9e018071


Always invoke setReuseAddress(true) regardless of OS.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/f9e01807
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f9e01807
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f9e01807

Branch: refs/heads/feature/GEODE-1233
Commit: f9e018071288e6ae7dcedd6c23bfe15aec76f0a6
Parents: 166320e
Author: Kirk Lund <kl...@apache.org>
Authored: Tue Apr 19 10:46:19 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Apr 19 10:46:19 2016 -0700

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/internal/AvailablePort.java   | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f9e01807/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
index 9417d7a..1f34538 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/AvailablePort.java
@@ -28,7 +28,6 @@ import java.util.Random;
 /**
  * This class determines whether or not a given port is available and
  * can also provide a randomly selected available port.
- *
  */
 public class AvailablePort {
 
@@ -195,10 +194,10 @@ public class AvailablePort {
     try {
       //(new Exception("Opening server socket on " + port)).printStackTrace();
       server = new ServerSocket();
-      String osName = System.getProperty("os.name");
-      if(osName != null && !osName.startsWith("Windows")) {
+      //String osName = System.getProperty("os.name");
+      //if(osName != null && !osName.startsWith("Windows")) {
         server.setReuseAddress(true);  
-      }      
+      //}
       if (addr != null) {
         server.bind(new InetSocketAddress(addr, port));
       }
@@ -211,7 +210,7 @@ public class AvailablePort {
     }
     catch (java.io.IOException ioe) {
       if (ioe.getMessage().equals("Network is unreachable")) {
-        throw new RuntimeException("Network is unreachable");
+        throw new RuntimeException("Network is unreachable", ioe);
       }
       //ioe.printStackTrace();
       if(addr instanceof Inet6Address) {