aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/Ivy.java4
-rwxr-xr-xsrc/IvyClient.java14
-rw-r--r--src/IvyDaemon.java4
-rwxr-xr-xsrc/IvyWatcher.java2
-rw-r--r--src/Makefile3
-rw-r--r--src/Probe.java2
6 files changed, 25 insertions, 4 deletions
diff --git a/src/Ivy.java b/src/Ivy.java
index 5e149ec..5c11066 100755
--- a/src/Ivy.java
+++ b/src/Ivy.java
@@ -60,7 +60,7 @@ public class Ivy implements Runnable {
* the library version, useful for development purposes only, when java is
* invoked with -DIVY_DEBUG
*/
- public static final String libVersion ="1.2.1";
+ public static final String libVersion ="1.2.2";
private boolean debug;
private static int serial=0; /* an unique ID for each regexp */
@@ -431,6 +431,7 @@ public class Ivy implements Runnable {
* the service socket thread reader main loop
*/
public void run() {
+ // System.out.println("Ivy service Thread started"); // THREADDEBUG
Thread thisThread=Thread.currentThread();
while(thisThread==serverThread){
try {
@@ -447,6 +448,7 @@ public class Ivy implements Runnable {
}
}
traceDebug("stopping the server Thread");
+ // System.out.println("Ivy service Thread stopped"); // THREADDEBUG
}
diff --git a/src/IvyClient.java b/src/IvyClient.java
index d98bb0f..1556930 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -19,6 +19,10 @@ import gnu.regexp.*;
* created for each remote client.
*
* CHANGELOG:
+ * 1.2.2:
+ * - cleared a bug causing the CPU to be eating when a remote client left the
+ * bus. closes Damien Figarol bug reported on december, 2002. It is handled
+ * in the readline() thread
* 1.2.1:
* - removes a NullPointerException when stops pinging on a pinger that
* wasn't even started
@@ -187,11 +191,15 @@ public class IvyClient implements Runnable {
Thread thisThread = Thread.currentThread();
traceDebug("Connected from "+ socket.getInetAddress().getHostName()+ ":"+socket.getPort());
String msg = null;
+ // System.out.println("IvyClient Thread started"); // THREADDEBUG
while ( clientThread==thisThread ) {
try {
if ((msg=in.readLine()) != null ) {
if (doping && (pingerThread!=null)) pingerThread.interrupt();
newParseMsg(msg);
+ } else {
+ traceDebug("readline null ! leaving the thead");
+ break;
}
} catch (IvyException ie) {
ie.printStackTrace();
@@ -200,11 +208,11 @@ public class IvyClient implements Runnable {
if (thisThread!=clientThread) break;
} catch (IOException e) {
if (clientThread!=thisThread) break;
- traceDebug("abnormally Disconnected from "+
- socket.getInetAddress().getHostName()+":"+socket.getPort());
+ System.out.println("abnormally Disconnected from "+ socket.getInetAddress().getHostName()+":"+socket.getPort());
}
} // while
traceDebug("normally Disconnected from "+ appName);
+ // System.out.println("IvyClient Thread stopped"); // THREADDEBUG
}
private void sendBuffer( String buffer ) throws IvyException {
@@ -420,6 +428,7 @@ public class IvyClient implements Runnable {
boolean isPinging = false;
public void run() {
isPinging=true;
+ // System.out.println("Pinger Thread started"); // THREADDEBUG
while (isPinging) {
try {
Thread.sleep(PINGTIMEOUT);
@@ -427,6 +436,7 @@ public class IvyClient implements Runnable {
} catch (InterruptedException ie) {
}
}
+ // System.out.println("Pinger Thread stopped"); // THREADDEBUG
}
public void stopPinging() { isPinging=false; pingerThread.interrupt();}
}
diff --git a/src/IvyDaemon.java b/src/IvyDaemon.java
index a0560f5..13b6f0c 100644
--- a/src/IvyDaemon.java
+++ b/src/IvyDaemon.java
@@ -77,6 +77,7 @@ public class IvyDaemon implements Runnable {
* it could be a thread, but as long as we've got one ....
*/
public void run() {
+ // System.out.println("IvyDaemon Thread started"); // THREADDEBUG
while(isRunning){
try {
Socket socket = serviceSocket.accept();
@@ -86,18 +87,21 @@ public class IvyDaemon implements Runnable {
System.out.println("IvyDaemon DEBUG TCP socket reader caught an exception " + e.getMessage());
}
}
+ // System.out.println("IvyDaemon Thread stopped"); // THREADDEBUG
}
class SubReader extends Thread {
BufferedReader in;
SubReader(BufferedReader in) {this.in=in;start();}
public void run() {
+ // System.out.println("Subreader Thread started"); // THREADDEBUG
String msg = null;
try {
while ( ((msg=in.readLine()) != null )) { bus.sendMsg(msg); }
} catch (IOException ioe) {
System.out.println("exception ..." + ioe.getMessage());
}
+ // System.out.println("Subreader Thread stopped"); // THREADDEBUG
}
} // subclass SubReader
diff --git a/src/IvyWatcher.java b/src/IvyWatcher.java
index d64b0d6..7157c18 100755
--- a/src/IvyWatcher.java
+++ b/src/IvyWatcher.java
@@ -77,6 +77,7 @@ class IvyWatcher implements Runnable {
* the behaviour of each thread watching the UDP socket.
*/
public void run() {
+ // System.out.println("IvyWatcher Thread started"); // THREADDEBUG
Thread thisThread=Thread.currentThread();
traceDebug("beginning of a watcher Thread");
byte buf[] = new byte[256];
@@ -132,6 +133,7 @@ class IvyWatcher implements Runnable {
ioe.printStackTrace();
}
traceDebug("end of a watcher thread");
+ // System.out.println("IvyWatcher Thread stopped"); // THREADDEBUG
}
/**
diff --git a/src/Makefile b/src/Makefile
index 501cd24..6634419 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,6 @@
# Be sure to set this before compiling ...
-JIKESPATH = /usr/lib/j2re1.3/lib/rt.jar:/usr/share/java/gnu.getopt.jar:/usr/share/java/repository
+RTPATH = /usr/local/j2sdk1.4.1/jre/lib/rt.jar
+JIKESPATH = ${RTPATH}:/usr/share/java/gnu.getopt.jar:/usr/share/java/repository
JAVACOPTS = -d . -deprecation
.SUFFIXES: .java .class
SRCS = *.java
diff --git a/src/Probe.java b/src/Probe.java
index c72c2ad..0b8a73e 100644
--- a/src/Probe.java
+++ b/src/Probe.java
@@ -91,6 +91,7 @@ class Probe implements IvyApplicationListener, IvyMessageListener, Runnable {
}
public void run() {
+ // System.out.println("Probe Thread started"); // THREADDEBUG
Thread thisThread=Thread.currentThread();
String s;
while (looperThread==thisThread) {
@@ -110,6 +111,7 @@ class Probe implements IvyApplicationListener, IvyMessageListener, Runnable {
}
} //while
System.out.println("End of looping");
+ // System.out.println("Probe Thread stopped"); // THREADDEBUG
System.exit(0);
}