You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2006/07/01 21:54:41 UTC
svn commit: r418504 -
/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
Author: fhanik
Date: Sat Jul 1 12:54:41 2006
New Revision: 418504
URL: http://svn.apache.org/viewvc?rev=418504&view=rev
Log:
improved the sustainability of the process staying alive
Modified:
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java?rev=418504&r1=418503&r2=418504&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java Sat Jul 1 12:54:41 2006
@@ -14,6 +14,7 @@
public class SocketNioReceive {
+ protected static Object mutex = new Object();
public static void main(String[] args) throws Exception {
Member mbr = new MemberImpl("localhost", 9999, 0);
ChannelData data = new ChannelData();
@@ -29,7 +30,15 @@
receiver.setMessageListener(list);
receiver.start();
System.out.println("Listening on 9999");
- Thread.sleep(100000);
+ while (true) {
+ try {
+ synchronized (mutex) {
+ mutex.wait();
+ }
+ }catch (Throwable x) {
+ x.printStackTrace();
+ }
+ }
}
public static class MyList implements MessageListener {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org