tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r418504 - /tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
Date Sat, 01 Jul 2006 19:54:41 GMT
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


Mime
View raw message