tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r532434 - in /tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes: group/interceptors/TcpFailureDetector.java transport/AbstractSender.java transport/PooledSender.java transport/nio/ParallelNioSender.java
Date Wed, 25 Apr 2007 18:29:51 GMT
Author: fhanik
Date: Wed Apr 25 11:29:50 2007
New Revision: 532434

URL: http://svn.apache.org/viewvc?view=rev&rev=532434
Log:
Implement keep alive timeout logic

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/AbstractSender.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java?view=diff&rev=532434&r1=532433&r2=532434
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
Wed Apr 25 11:29:50 2007
@@ -198,7 +198,7 @@
         }catch ( Exception x ) {
             log.warn("Unable to perform heartbeat on the TcpFailureDetector.",x);
         } finally {
-            super.heartbeat();
+            
         }
     }
     

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/AbstractSender.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/AbstractSender.java?view=diff&rev=532434&r1=532433&r2=532434
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/AbstractSender.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/AbstractSender.java Wed
Apr 25 11:29:50 2007
@@ -113,7 +113,7 @@
     public boolean keepalive() {
         boolean disconnect = false;
         if ( keepAliveCount >= 0 && requestCount>keepAliveCount ) disconnect
= true;
-        else if ( keepAliveTime >= 0 && keepAliveTime> (System.currentTimeMillis()-connectTime)
) disconnect = true;
+        else if ( keepAliveTime >= 0 && (System.currentTimeMillis()-connectTime)>keepAliveTime
) disconnect = true;
         if ( disconnect ) disconnect();
         return disconnect;
     }

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java?view=diff&rev=532434&r1=532433&r2=532434
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/PooledSender.java Wed Apr
25 11:29:50 2007
@@ -80,7 +80,7 @@
 
     public boolean keepalive() {
         //do nothing, the pool checks on every return
-        return false;
+        return (queue==null)?false:queue.checkIdleKeepAlive();
     }
 
     
@@ -129,6 +129,16 @@
          */
         public int getInPoolSize() {
             return notinuse.size();
+        }
+        
+        public synchronized boolean checkIdleKeepAlive() {
+            DataSender[] list = new DataSender[notinuse.size()];
+            notinuse.toArray(list);
+            boolean result = false;
+            for (int i=0; i<list.length; i++) {
+                result = result | list[i].keepalive();
+            }
+            return result;
         }
 
         public synchronized DataSender getSender(long timeout) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java?view=diff&rev=532434&r1=532433&r2=532434
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java
Wed Apr 25 11:29:50 2007
@@ -285,6 +285,7 @@
             NioSender sender = (NioSender)entry.getValue();
             if ( sender.keepalive() ) {
                 nioSenders.remove(entry.getKey());
+                result = true;
             }
         }
         return result;



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


Mime
View raw message