directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r263846 - in /directory/network: branches/0.7/src/java/org/apache/mina/io/socket/SocketIoProcessor.java branches/0.7/src/java/org/apache/mina/util/BaseThreadPool.java trunk/src/java/org/apache/mina/transport/socket/nio/SocketIoProcessor.java
Date Sun, 28 Aug 2005 09:07:46 GMT
Author: trustin
Date: Sun Aug 28 02:07:38 2005
New Revision: 263846

URL: http://svn.apache.org/viewcvs?rev=263846&view=rev
Log:
Fix for DIRMINA-83 - SocketIoProcessor halts if channel is closed while flushing.
* Added catch clause for CancelledKeyException in flushSessions()


Modified:
    directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
    directory/network/branches/0.7/src/java/org/apache/mina/util/BaseThreadPool.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketIoProcessor.java

Modified: directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?rev=263846&r1=263845&r2=263846&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
(original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Sun Aug 28 02:07:38 2005
@@ -421,6 +421,11 @@
                 {
                     flush( session );
                 }
+                catch( CancelledKeyException e )
+                {
+                    // Connection is closed unexpectedly.
+                    scheduleRemove( session );
+                }
                 catch( IOException e )
                 {
                     scheduleRemove( session );

Modified: directory/network/branches/0.7/src/java/org/apache/mina/util/BaseThreadPool.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/util/BaseThreadPool.java?rev=263846&r1=263845&r2=263846&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/util/BaseThreadPool.java (original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/util/BaseThreadPool.java Sun Aug
28 02:07:38 2005
@@ -342,7 +342,7 @@
         private SessionBuffer fetchBuffer()
         {
             SessionBuffer buf;
-            BlockingSet readySessionBuffers = ThreadPoolFilter.this.readySessionBuffers;
+            BlockingSet readySessionBuffers = BaseThreadPool.this.readySessionBuffers;
             synchronized( readySessionBuffers )
             {
                 for( ;; )
@@ -492,7 +492,7 @@
 
         private void giveUpLead()
         {
-            final Stack followers = ThreadPoolFilter.this.followers;
+            final Stack followers = BaseThreadPool.this.followers;
             Worker worker;
             do
             {

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketIoProcessor.java?rev=263846&r1=263845&r2=263846&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketIoProcessor.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/SocketIoProcessor.java
Sun Aug 28 02:07:38 2005
@@ -19,6 +19,7 @@
 package org.apache.mina.transport.socket.nio;
 
 import java.io.IOException;
+import java.nio.channels.CancelledKeyException;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
@@ -421,6 +422,11 @@
                 try
                 {
                     flush( session );
+                }
+                catch( CancelledKeyException e )
+                {
+                    // Connection is closed unexpectedly.
+                    scheduleRemove( session );
                 }
                 catch( IOException e )
                 {



Mime
View raw message