directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r158285 - directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Date Sun, 20 Mar 2005 03:14:41 GMT
Author: trustin
Date: Sat Mar 19 19:14:40 2005
New Revision: 158285

URL: http://svn.apache.org/viewcvs?view=rev&rev=158285
Log:
Fixed spinning loop while kernel socket buffer is full.

Modified:
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java

Modified: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?view=diff&r1=158284&r2=158285
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java Sat
Mar 19 19:14:40 2005
@@ -439,6 +439,13 @@
             }
             finally
             {
+                if( writtenBytes > 0 )
+                {
+                    session.increaseWrittenBytes( writtenBytes );
+                    session.setIdle( IdleStatus.BOTH_IDLE, false );
+                    session.setIdle( IdleStatus.WRITER_IDLE, false );
+                }
+
                 SelectionKey key = session.getSelectionKey();
                 if( buf.hasRemaining() )
                 {
@@ -446,18 +453,12 @@
                     key
                             .interestOps( key.interestOps()
                                           | SelectionKey.OP_WRITE );
+                    break;
                 }
                 else
                 {
                     key.interestOps( key.interestOps()
                                      & ( ~SelectionKey.OP_WRITE ) );
-                }
-
-                if( writtenBytes > 0 )
-                {
-                    session.increaseWrittenBytes( writtenBytes );
-                    session.setIdle( IdleStatus.BOTH_IDLE, false );
-                    session.setIdle( IdleStatus.WRITER_IDLE, false );
                 }
             }
         }



Mime
View raw message