Accept doesn't need a worker thread, the operations are non blocking
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 21 Feb 2007 16:52:22 +0000 (16:52 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 21 Feb 2007 16:52:22 +0000 (16:52 +0000)
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

index 453e052..7fc88c8 100644 (file)
@@ -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);
                 }