From c333f85fa853d5ec5e1ae6b0795c86b3f868f814 Mon Sep 17 00:00:00 2001 From: fhanik Date: Wed, 21 Feb 2007 16:52:22 +0000 Subject: [PATCH] Accept doesn't need a worker thread, the operations are non blocking git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@510098 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/net/NioEndpoint.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 453e0523a..7fc88c8c7 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1033,7 +1033,18 @@ public class NioEndpoint { // Hand this socket off to an appropriate processor //TODO FIXME - this is currently a blocking call, meaning we will be blocking //further accepts until there is a thread available. - if ( running && (!paused) && socket != null ) processSocket(socket); + if ( running && (!paused) && socket != null ) { + //processSocket(socket); + if (!setSocketOptions(socket)) { + try { + socket.socket().close(); + socket.close(); + } catch (IOException ix) { + if (log.isDebugEnabled()) + log.debug("", ix); + } + } + } } catch (Throwable t) { log.error(sm.getString("endpoint.accept.fail"), t); } -- 2.11.0