tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r419332 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes: io/ObjectReader.java transport/ReceiverBase.java transport/nio/NioReplicationThread.java
Date Wed, 05 Jul 2006 20:30:14 GMT
Author: fhanik
Date: Wed Jul  5 13:30:13 2006
New Revision: 419332

URL: http://svn.apache.org/viewvc?rev=419332&view=rev
Log:
Avoid over processing single connections, handle one package at a time

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java?rev=419332&r1=419331&r2=419332&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
Wed Jul  5 13:30:13 2006
@@ -126,6 +126,10 @@
         return buffer.getLength();
     }
     
+
+    public boolean hasPackage() {
+        return buffer.countPackages(true)>0;
+    }
     /**
      * Returns the number of packages that the reader has read
      * @return int

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java?rev=419332&r1=419331&r2=419332&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java
Wed Jul  5 13:30:13 2006
@@ -57,7 +57,7 @@
     private long tcpSelectorTimeout = 5000;
     //how many times to search for an available socket
     private int autoBind = 10;
-    private int maxThreads = 25;
+    private int maxThreads = 15;
     private int minThreads = 6;
     private boolean tcpNoDelay = true;
     private boolean soKeepAlive = false;
@@ -190,7 +190,7 @@
     
     public void messageDataReceived(ChannelMessage data) {
         if ( this.listener != null ) {
-            listener.messageReceived(data);
+            if ( listener.accept(data) ) listener.messageReceived(data);
         }
     }
     

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java?rev=419332&r1=419331&r2=419332&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java
Wed Jul  5 13:30:13 2006
@@ -143,6 +143,8 @@
             else 
                 reader.append(buffer,count,false);
             buffer.clear();		// make buffer empty
+            //do we have at least one package?
+            if ( reader.hasPackage() ) break;
         }
 
         int pkgcnt = reader.count();



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


Mime
View raw message