summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-04 19:05:06 +0200
committerSven Gothel <[email protected]>2012-10-04 19:05:06 +0200
commit7a89ef6efd332845f29328c6167919b294183764 (patch)
tree80ef827015a38213696c0b2fff9420bca678d877
parent2cbc4badb7fed2cc94128fda0fc381964b1b1f8d (diff)
SingletonInstanceServerSocket: serverSocket.setReuseAddress(true); // reuse same port w/ subsequent instance, i.e. overcome TO state when JVM crashed
-rwxr-xr-xmake/scripts/runtest.sh3
-rw-r--r--src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java1
2 files changed, 2 insertions, 2 deletions
diff --git a/make/scripts/runtest.sh b/make/scripts/runtest.sh
index 12788b6..30d5d5b 100755
--- a/make/scripts/runtest.sh
+++ b/make/scripts/runtest.sh
@@ -73,10 +73,9 @@ function onetest() {
#onetest com.jogamp.common.util.TestIteratorIndexCORE 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.locks.TestRecursiveLock01 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.locks.TestRecursiveThreadGroupLock01 2>&1 | tee -a $LOG
-#onetest com.jogamp.common.util.locks.TestSingletonServerSocket00 2>&1 | tee -a $LOG
+onetest com.jogamp.common.util.locks.TestSingletonServerSocket00 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.locks.TestSingletonServerSocket01 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.locks.TestSingletonServerSocket02 2>&1 | tee -a $LOG
-onetest com.jogamp.common.util.locks.TestSingletonServerSocket02 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.TestArrayHashSet01 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.IntIntHashMapTest 2>&1 | tee -a $LOG
#onetest com.jogamp.common.util.IntObjectHashMapTest 2>&1 | tee -a $LOG
diff --git a/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java b/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java
index dac6e72..fb31ab6 100644
--- a/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java
+++ b/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java
@@ -225,6 +225,7 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
synchronized (syncOnStartStop) {
try {
serverSocket = new ServerSocket(portNumber, 1, localInetAddress);
+ serverSocket.setReuseAddress(true); // reuse same port w/ subsequent instance, i.e. overcome TO state when JVM crashed
alive = true;
} catch (IOException e) {
System.err.println(infoPrefix()+" III - Unable to install ServerSocket: "+e.getMessage());