aboutsummaryrefslogtreecommitdiff
path: root/src/IvyWatcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/IvyWatcher.java')
-rwxr-xr-xsrc/IvyWatcher.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/IvyWatcher.java b/src/IvyWatcher.java
index 93d5a8f..b37fa6b 100755
--- a/src/IvyWatcher.java
+++ b/src/IvyWatcher.java
@@ -65,11 +65,8 @@ package fr.dgac.ivy ;
import java.lang.Thread;
import java.net.*;
import java.io.*;
-import java.util.StringTokenizer;
import org.apache.regexp.*;
import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Enumeration;
class IvyWatcher implements Runnable {
private static boolean debug = (System.getProperty("IVY_DEBUG")!=null);
@@ -156,7 +153,12 @@ class IvyWatcher implements Runnable {
+":"+packet.getPort()+", port:"+remotePort+", protocol version:"+version);
if (!alreadyBroadcasted(remotehost.toString(),remotePort)) {
traceDebug("no known agent originating from " + remotehost + ":" + remotePort);
- new IvyClient(bus,new Socket(remotehost,remotePort),remotePort);
+ try {
+ Socket s = new Socket(remotehost,remotePort);
+ new IvyClient(bus,s,remotePort,false);
+ } catch ( java.net.ConnectException jnc ) {
+ traceDebug("cannot connect to "+remotehostname+":"+remotePort+", he probably stopped his bus");
+ }
} else {
traceDebug("there is already a request originating from " + remotehost + ":" + remotePort);
}
@@ -240,8 +242,10 @@ class IvyWatcher implements Runnable {
* went local instead of static ! fixed a nasty bug in 1.2.8
* checks if there is already a broadcast received from the same address
* on the same port
+ *
+ * regoes static ...
*/
- private Hashtable alreadySocks=new Hashtable();
+ private static Hashtable alreadySocks=new Hashtable();
private synchronized boolean alreadyBroadcasted(String s,int port) {
// System.out.println("DEBUUUUUUUG " + s+ ":" + port);
if (s==null) return false;