directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r329207 - in /directory/network/trunk/src/java/org/apache/mina: common/support/BaseIoSession.java transport/socket/nio/support/SocketIoProcessor.java transport/vmpipe/support/VmPipeFilter.java
Date Fri, 28 Oct 2005 14:14:25 GMT
Author: trustin
Date: Fri Oct 28 07:14:18 2005
New Revision: 329207

URL: http://svn.apache.org/viewcvs?rev=329207&view=rev
Log:
Removed BaseIoSession.resetIdleCount() and included counter reset code to increase(Read|Written)Bytes().

Modified:
    directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
    directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java

Modified: directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java?rev=329207&r1=329206&r2=329207&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java Fri
Oct 28 07:14:18 2005
@@ -190,12 +190,16 @@
     {
         readBytes += increment;
         lastReadTime = System.currentTimeMillis();
+        idleCountForBoth = 0;
+        idleCountForWrite = 0;
     }
 
     public void increaseWrittenBytes( int increment )
     {
         writtenBytes += increment;
         lastWriteTime = System.currentTimeMillis();
+        idleCountForBoth = 0;
+        idleCountForWrite = 0;
     }
     
     public void increaseWrittenWriteRequests()
@@ -282,19 +286,6 @@
             idleCountForWrite ++;
             lastIdleTimeForWrite = System.currentTimeMillis();
         }
-        else
-            throw new IllegalArgumentException( "Unknown idle status: "
-                                                + status );
-    }
-
-    public void resetIdleCount( IdleStatus status )
-    {
-        if( status == IdleStatus.BOTH_IDLE )
-            idleCountForBoth = 0;
-        else if( status == IdleStatus.READER_IDLE )
-            idleCountForRead = 0;
-        else if( status == IdleStatus.WRITER_IDLE )
-            idleCountForWrite = 0;
         else
             throw new IllegalArgumentException( "Unknown idle status: "
                                                 + status );

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java?rev=329207&r1=329206&r2=329207&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
Fri Oct 28 07:14:18 2005
@@ -275,8 +275,6 @@
             }
 
             session.increaseReadBytes( readBytes );
-            session.resetIdleCount( IdleStatus.BOTH_IDLE );
-            session.resetIdleCount( IdleStatus.READER_IDLE );
 
             if( readBytes > 0 )
             {
@@ -505,8 +503,6 @@
                 if( writtenBytes > 0 )
                 {
                     session.increaseWrittenBytes( writtenBytes );
-                    session.resetIdleCount( IdleStatus.BOTH_IDLE );
-                    session.resetIdleCount( IdleStatus.WRITER_IDLE );
                 }
 
                 SelectionKey key = session.getSelectionKey();

Modified: directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java?rev=329207&r1=329206&r2=329207&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/vmpipe/support/VmPipeFilter.java
Fri Oct 28 07:14:18 2005
@@ -3,7 +3,6 @@
  */
 package org.apache.mina.transport.vmpipe.support;
 
-import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoFilterAdapter;
 import org.apache.mina.common.IoSession;
 
@@ -20,8 +19,6 @@
     {
         VmPipeSessionImpl vps = ( VmPipeSessionImpl ) session;
 
-        vps.resetIdleCount( IdleStatus.BOTH_IDLE );
-        vps.resetIdleCount( IdleStatus.READER_IDLE );
         vps.increaseReadBytes( 1 );
 
         // fire messageSent event first
@@ -35,8 +32,6 @@
                              IoSession session, Object message )
     {
         VmPipeSessionImpl vps = ( VmPipeSessionImpl ) session;
-        vps.resetIdleCount( IdleStatus.BOTH_IDLE );
-        vps.resetIdleCount( IdleStatus.WRITER_IDLE );
         vps.increaseWrittenBytes( 1 );
         vps.increaseWrittenWriteRequests();
 



Mime
View raw message