cancel the keys
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 30 Oct 2006 18:07:22 +0000 (18:07 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 30 Oct 2006 18:07:22 +0000 (18:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@469212 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/NioEndpoint.java

index fc47164..e834d69 100644 (file)
@@ -1457,6 +1457,8 @@ public class NioEndpoint {
                                     KeyAttachment att = (KeyAttachment)socket.getAttachment(true);
                                     try {socket.close();}catch (Exception ignore){}
                                     if ( socket.isOpen() ) socket.close(true);
+                                    key.cancel();
+                                    key.attach(null);
                                     nioChannels.offer(socket);
                                     if ( att!=null ) keyCache.offer(att);
                                 }catch ( Exception x ) {
@@ -1468,6 +1470,8 @@ public class NioEndpoint {
                                     KeyAttachment att = (KeyAttachment)socket.getAttachment(true);
                                     try {socket.close();}catch (Exception ignore){}
                                     if ( socket.isOpen() ) socket.close(true);
+                                    key.cancel();
+                                    key.attach(null);
                                     nioChannels.offer(socket);
                                     if ( att!=null ) keyCache.offer(att);
                                 }catch ( Exception x ) {