aboutsummaryrefslogtreecommitdiff
path: root/src/IvyWatcher.java
diff options
context:
space:
mode:
authorjestin2012-05-12 14:26:08 +0000
committerjestin2012-05-12 14:26:08 +0000
commit4ffe8b84071babe544086f94c66431380d301d59 (patch)
tree12c9c3a4d6f00c071d8cd298f041dc383e887ff7 /src/IvyWatcher.java
parent6fbefad24ec7e8783365db61b03357d50ee0dd56 (diff)
downloadivy-java-4ffe8b84071babe544086f94c66431380d301d59.zip
ivy-java-4ffe8b84071babe544086f94c66431380d301d59.tar.gz
ivy-java-4ffe8b84071babe544086f94c66431380d301d59.tar.bz2
ivy-java-4ffe8b84071babe544086f94c66431380d301d59.tar.xz
- minor code cleanup
- adds a separate file (Protocol.java) containing the Enum values in a proper pattern - resolved a synchronization bug on Ivy.stop()
Diffstat (limited to 'src/IvyWatcher.java')
-rwxr-xr-xsrc/IvyWatcher.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/IvyWatcher.java b/src/IvyWatcher.java
index cbd3910..f6507bb 100755
--- a/src/IvyWatcher.java
+++ b/src/IvyWatcher.java
@@ -116,6 +116,7 @@ class IvyWatcher extends Thread {
busWatcherId=bus.getWatcherId();
listenThread = new Thread(this);
listenThread.setName("Ivy Watcher thread for "+domainaddr+":"+port);
+ listenThread.setDaemon(true);
// create the MulticastSocket
try {
group = InetAddress.getByName(domainaddr);
@@ -156,10 +157,10 @@ class IvyWatcher extends Thread {
continue;
}
int version = Integer.parseInt(m.group(1));
- if ( version < Ivy.PROTOCOLMINIMUM ) {
+ if ( version < Protocol.PROTOCOLMINIMUM ) {
System.err.println("Ignoring bad format broadcast from "+
remotehostname+":"+packet.getPort()
- +" protocol version "+remotehost+" we need "+Ivy.PROTOCOLMINIMUM+" minimum");
+ +" protocol version "+remotehost+" we need "+Protocol.PROTOCOLMINIMUM+" minimum");
continue;
}
remotePort = Integer.parseInt(m.group(2));
@@ -291,7 +292,7 @@ class IvyWatcher extends Thread {
synchronized void doStart() throws IvyException {
// String hello = Ivy.PROTOCOLVERSION + " " + bus.getAppPort() + "\n";
- String hello = Ivy.PROTOCOLVERSION + " " + bus.getAppPort() + " "+busWatcherId+" "+bus.getSelfIvyClient().getApplicationName()+"\n";
+ String hello = Protocol.PROTOCOLVERSION + " " + bus.getAppPort() + " "+busWatcherId+" "+bus.getSelfIvyClient().getApplicationName()+"\n";
if (broadcast==null) throw new IvyException("IvyWatcher PacketSender null broadcast address");
new PacketSender(hello,bus); // notifies our arrival on each domain: protocol version + port
listenThread.start();