aboutsummaryrefslogtreecommitdiff
path: root/src/IvyWatcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/IvyWatcher.java')
-rwxr-xr-xsrc/IvyWatcher.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/IvyWatcher.java b/src/IvyWatcher.java
index 004c704..d64b0d6 100755
--- a/src/IvyWatcher.java
+++ b/src/IvyWatcher.java
@@ -22,6 +22,11 @@ import java.util.Enumeration;
* thing.
*
* CHANGELOG:
+ * 1.2.1:
+ * - changed the fill character from 0 to 10, in order to prevent a nasty bug
+ * on Windows XP machines
+ * - fixed a NullPointerException while trying to stop a Thread before having
+ * created it.
* 1.0.12:
* - setSoTimeout on socket
* - the broadcast reader Thread goes volatile
@@ -82,7 +87,9 @@ class IvyWatcher implements Runnable {
try {
broadcast.receive(packet);
String msg = new String(packet.getData()) ;
- for (int i=0;i<buf.length;i++) { buf[i]=0; } // clean up the buffer after each message
+ for (int i=0;i<buf.length;i++) { buf[i]=10; }
+ // clean up the buffer after each message
+ // BUGFIX ? I change 0 to 10 in order to avoid a bug
InetAddress remotehost = packet.getAddress();
traceDebug("BUSWATCHER Receive Broadcast from "+ remotehost.getHostName()+":"+packet.getPort());
// TODO if ( !isInDomain( remotehost ) ) continue;
@@ -135,7 +142,7 @@ class IvyWatcher implements Runnable {
Thread t = listenThread;
listenThread=null;
broadcast.close();
- t.interrupt();
+ if (t!=null) { t.interrupt(); } // it might not even have been created
traceDebug("ending stopping an IvyWatcher");
}
@@ -185,7 +192,7 @@ class IvyWatcher implements Runnable {
System.out.println("Bad broascat addr " + net);
return null;
}
- //System.out.println("net: "+net);
+ // System.out.println("net: "+net);
return net;
}