From 5b95c68bb00e4c3f6cdc2e46eb853a47c11b0280 Mon Sep 17 00:00:00 2001 From: fhanik Date: Mon, 30 Oct 2006 18:07:22 +0000 Subject: [PATCH] cancel the keys 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index fc47164de..e834d69b4 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -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 ) { -- 2.11.0