diff options
author | jestin | 2012-05-12 14:26:08 +0000 |
---|---|---|
committer | jestin | 2012-05-12 14:26:08 +0000 |
commit | 4ffe8b84071babe544086f94c66431380d301d59 (patch) | |
tree | 12c9c3a4d6f00c071d8cd298f041dc383e887ff7 /src/IvyDaemon.java | |
parent | 6fbefad24ec7e8783365db61b03357d50ee0dd56 (diff) | |
download | ivy-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/IvyDaemon.java')
-rw-r--r-- | src/IvyDaemon.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/IvyDaemon.java b/src/IvyDaemon.java index 2c0e42a..6fc884d 100644 --- a/src/IvyDaemon.java +++ b/src/IvyDaemon.java @@ -1,5 +1,6 @@ /** - * IvyDaemon: simple TCP to Ivy relay. + * IvyDaemon: simple TCP to Ivy relay, can be useful if a shell command wants + * to send a message on the bus. * * @author Yannick Jestin * @author <a href="http://www.tls.cena.fr/products/ivy/">http://www.tls.cena.fr/products/ivy/</a> @@ -20,7 +21,7 @@ * - goes into tools subpackage * 1.2.3 * - adds the traceDebug - * - uses the clientThread paradigm to programm the thread sync + * - uses the daemonThread paradigm to programm the thread sync * - invalid port number as a command line argument now stops the program * - cleans up the code * - adds a "quiet" option on the command line @@ -41,7 +42,7 @@ public class IvyDaemon implements Runnable { private ServerSocket serviceSocket; private static boolean debug = (System.getProperty("IVY_DEBUG")!=null) ; - private volatile Thread clientThread;// volatile to ensure the quick communication + private volatile Thread daemonThread;// volatile to ensure the quick communication private Ivy bus; public static final int DEFAULT_SERVICE_PORT = 3456 ; @@ -94,12 +95,12 @@ public class IvyDaemon implements Runnable { public IvyDaemon(Ivy bus,int servicePort) throws IOException { this.bus=bus; serviceSocket = new ServerSocket(servicePort) ; - clientThread=new Thread(this); - clientThread.setName("Ivy client thread set by Daemon ?! "); + daemonThread=new Thread(this); + daemonThread.setName("Ivy Daemon tool thread"); } protected void doStart() { - clientThread.start(); + daemonThread.start(); } /* @@ -109,7 +110,7 @@ public class IvyDaemon implements Runnable { public void run() { Thread thisThread = Thread.currentThread(); traceDebug("Thread started"); - while ( clientThread==thisThread ) { + while ( daemonThread==thisThread ) { try { new SubReader(serviceSocket.accept()); } catch( IOException e ) { |