Put a short timeout on the unlock accept
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 9 Jun 2009 22:28:00 +0000 (22:28 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 9 Jun 2009 22:28:00 +0000 (22:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@783160 13f79535-47bb-0310-9956-ffa450edef68

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

index 4339d2f..8a5981d 100644 (file)
@@ -1034,8 +1034,10 @@ public class NioEndpoint {
             // Need to create a connection to unlock the accept();
             if (address == null) {
                 s = new java.net.Socket("127.0.0.1", port);
+                s.setSoTimeout(2000);
             } else {
                 s = new java.net.Socket(address, port);
+                s.setSoTimeout(2000);
                 // setting soLinger to a small value will help shutdown the
                 // connection quicker
                 s.setSoLinger(true, 0);