directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r165085 - /directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Date Thu, 28 Apr 2005 02:04:45 GMT
Author: trustin
Date: Wed Apr 27 19:04:45 2005
New Revision: 165085

URL: http://svn.apache.org/viewcvs?rev=165085&view=rev
Log:
Fixed: sessionClosed is called more than once sometimes in TCP/IP transport type.

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?rev=165085&r1=165084&r2=165085&view=diff
==============================================================================
--- 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 Wed
Apr 27 19:04:45 2005
@@ -189,10 +189,15 @@
                 break;
 
             SocketChannel ch = session.getChannel();
-            session.getSelectionKey().cancel();
+            SelectionKey key = session.getSelectionKey();
+            if( !key.isValid() ) // skip if channel is already closed
+            {
+                continue;
+            }
 
             try
             {
+                key.cancel();
                 ch.close();
             }
             catch( IOException e )



Mime
View raw message