Hi,
I set keepAliveTimeout in <Connector> in server.xml and found the parameter does not work.
JBoss Web Configuration Reference - The HTTP Connector says: "keepAliveTimeout: The number of milliseconds this Connector will wait for another HTTP request before closing the connection. The default value is to use the value that has been set for the connectionTimeout attribute." At first glance, i thought it should be set to socket's soTimeout finally, but after checking jbossweb source code , i found the following: http://anonsvn.jboss.org/repos/jbossweb/tags/JBOSSWEB_2_1_14_GA/java/org/apache/coyote/http11/Http11Processor.java
boolean keptAlive = false;
while (started && !error && keepAlive) {
// Parsing the request header
try {
if (!disableUploadTimeout && keptAlive) { ---------since keptAlive==false, keepAliveTimeout will never be set to soTimeout. keepAliveTimeout does not work!
if (keepAliveTimeout > 0) {
socket.setSoTimeout(keepAliveTimeout);
}
else if (soTimeout > 0) {
socket.setSoTimeout(soTimeout);
}
}
inputBuffer.parseRequestLine();
request.setStartTime(System.currentTimeMillis());
keptAlive = true;
if (!disableUploadTimeout) {
socket.setSoTimeout(timeout);
}
inputBuffer.parseHeaders();
} catch (IOException e) {
error = true;
break;
keepAliveTimeout is useless, right?
Regards,
Yaguo