tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r407924 - in /tomcat/container/tc5.5.x/modules/groupcom: src/share/org/apache/catalina/tribes/membership/McastServiceImpl.java test/java/org/apache/catalina/tribes/test/membership/TestTcpFailureDetector.java
Date Fri, 19 May 2006 22:45:57 GMT
Author: fhanik
Date: Fri May 19 15:45:57 2006
New Revision: 407924

URL: http://svn.apache.org/viewvc?rev=407924&view=rev
Log:
By always sending a mcast packet synchronously, we don't have to worry about context switching
and lag times

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/McastServiceImpl.java
    tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/membership/TestTcpFailureDetector.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/McastServiceImpl.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/McastServiceImpl.java?rev=407924&r1=407923&r2=407924&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/McastServiceImpl.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/McastServiceImpl.java
Fri May 19 15:45:57 2006
@@ -191,7 +191,7 @@
         boolean valid = false;
         if ( (level & Channel.MBR_RX_SEQ)==Channel.MBR_RX_SEQ ) {
             if ( receiver != null ) throw new IllegalStateException("McastService.receive
already running.");
-            socket.joinGroup(address);
+            if ( sender == null ) socket.joinGroup(address);
             doRunReceiver = true;
             receiver = new ReceiverThread();
             receiver.setDaemon(true);
@@ -206,6 +206,9 @@
         } 
         if ( (level & Channel.MBR_TX_SEQ)==Channel.MBR_TX_SEQ ) {
             if ( sender != null ) throw new IllegalStateException("McastService.send already
running.");
+            if ( receiver == null ) socket.joinGroup(address);
+            //make sure at least one packet gets out there
+            send();
             doRunSender = true;
             serviceStartTime = System.currentTimeMillis();
             sender = new SenderThread(sendFrequency);

Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/membership/TestTcpFailureDetector.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/membership/TestTcpFailureDetector.java?rev=407924&r1=407923&r2=407924&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/membership/TestTcpFailureDetector.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/membership/TestTcpFailureDetector.java
Fri May 19 15:45:57 2006
@@ -56,7 +56,7 @@
         clear();
         channel1.start(channel1.DEFAULT);
         channel2.start(channel2.DEFAULT);
-        Thread.sleep(1000);
+        //Thread.sleep(1000);
         assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
         channel2.stop(channel2.SND_RX_SEQ);
         ByteMessage msg = new ByteMessage(new byte[1024]);
@@ -80,7 +80,7 @@
         channel2.start(channel2.MBR_RX_SEQ);
         channel2.stop(channel2.SND_RX_SEQ);
         channel2.start(channel2.MBR_TX_SEQ);
-        Thread.sleep(1000);
+        //Thread.sleep(1000);
         assertEquals("Expecting member count to not be equal",mbrlist1.members.size()+1,mbrlist2.members.size());
         channel1.stop(Channel.DEFAULT);
         channel2.stop(Channel.DEFAULT);
@@ -91,7 +91,7 @@
         clear();
         channel1.start(channel1.DEFAULT);
         channel2.start(channel2.DEFAULT);
-        Thread.sleep(1000);
+        //Thread.sleep(1000);
         assertEquals("Expecting member count to be equal",mbrlist1.members.size(),mbrlist2.members.size());
         channel2.stop(channel2.MBR_TX_SEQ);
         ByteMessage msg = new ByteMessage(new byte[1024]);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message