directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r329947 - in /directory/network: branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
Date Tue, 01 Nov 2005 01:24:23 GMT
Author: trustin
Date: Mon Oct 31 17:24:16 2005
New Revision: 329947

URL: http://svn.apache.org/viewcvs?rev=329947&view=rev
Log:
Removed unnecessary interestOps calls


Modified:
    directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java

Modified: directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?rev=329947&r1=329946&r2=329947&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
(original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Mon Oct 31 17:24:16 2005
@@ -459,6 +459,10 @@
 
     private void flush( SocketSession session ) throws IOException
     {
+        // Clear OP_WRITE
+        SelectionKey key = session.getSelectionKey();
+        key.interestOps( key.interestOps() & ( ~SelectionKey.OP_WRITE ) );
+
         SocketChannel ch = session.getChannel();
 
         Queue writeBufferQueue = session.getWriteBufferQueue();
@@ -506,16 +510,11 @@
                 session.resetIdleCount( IdleStatus.WRITER_IDLE );
             }
 
-            SelectionKey key = session.getSelectionKey();
             if( buf.hasRemaining() )
             {
                 // Kernel buffer is full
                 key.interestOps( key.interestOps() | SelectionKey.OP_WRITE );
                 break;
-            }
-            else
-            {
-                key.interestOps( key.interestOps() & ( ~SelectionKey.OP_WRITE ) );
             }
         }
     }

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=329947&r1=329946&r2=329947&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
Mon Oct 31 17:24:16 2005
@@ -460,8 +460,11 @@
 
     private void flush( SocketSessionImpl session ) throws IOException
     {
-        SocketChannel ch = session.getChannel();
+        // Clear OP_WRITE
+        SelectionKey key = session.getSelectionKey();
+        key.interestOps( key.interestOps() & ( ~SelectionKey.OP_WRITE ) );
 
+        SocketChannel ch = session.getChannel();
         Queue writeRequestQueue = session.getWriteRequestQueue();
 
         WriteRequest req;
@@ -495,16 +498,11 @@
                 session.increaseWrittenBytes( writtenBytes );
             }
 
-            SelectionKey key = session.getSelectionKey();
             if( buf.hasRemaining() )
             {
                 // Kernel buffer is full
                 key.interestOps( key.interestOps() | SelectionKey.OP_WRITE );
                 break;
-            }
-            else
-            {
-                key.interestOps( key.interestOps() & ( ~SelectionKey.OP_WRITE ) );
             }
         }
     }



Mime
View raw message