directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r405288 - in /directory: branches/mina/0.8/src/java/org/apache/mina/io/socket/SocketConnector.java trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
Date Tue, 09 May 2006 03:26:41 GMT
Author: trustin
Date: Mon May  8 20:26:37 2006
New Revision: 405288

URL: http://svn.apache.org/viewcvs?rev=405288&view=rev
Log:
Fixed issue: DIRMINA-212 (Possible connection leak in SocketConnector)


Modified:
    directory/branches/mina/0.8/src/java/org/apache/mina/io/socket/SocketConnector.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java

Modified: directory/branches/mina/0.8/src/java/org/apache/mina/io/socket/SocketConnector.java
URL: http://svn.apache.org/viewcvs/directory/branches/mina/0.8/src/java/org/apache/mina/io/socket/SocketConnector.java?rev=405288&r1=405287&r2=405288&view=diff
==============================================================================
--- directory/branches/mina/0.8/src/java/org/apache/mina/io/socket/SocketConnector.java (original)
+++ directory/branches/mina/0.8/src/java/org/apache/mina/io/socket/SocketConnector.java Mon
May  8 20:26:37 2006
@@ -277,7 +277,18 @@
                     entry.notify();
                 }
 
-                key.cancel();
+                try
+                {
+                    key.channel().close();
+                }
+                catch( IOException e )
+                {
+                    exceptionMonitor.exceptionCaught( this, e );
+                }
+                finally
+                {
+                    key.cancel();
+                }
             }
         }
     }

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java?rev=405288&r1=405287&r2=405288&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
Mon May  8 20:26:37 2006
@@ -328,7 +328,18 @@
             if( currentTime >= entry.deadline )
             {
                 entry.setException( new ConnectException() );
-                key.cancel();
+                try
+                {
+                    key.channel().close();
+                }
+                catch( IOException e )
+                {
+                    ExceptionMonitor.getInstance().exceptionCaught( e );
+                }
+                finally
+                {
+                    key.cancel();
+                }
             }
         }
     }



Mime
View raw message