public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
- public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
public static final int PROCESSOR_IDLE = 0;
public static final int PROCESSOR_ACTIVE = 1;
cHandler = new AjpConnectionHandler(this);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
+ setKeepAliveTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
//setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
}
public static final int DEFAULT_CONNECTION_LINGER = -1;
public static final int DEFAULT_CONNECTION_TIMEOUT = -1;
public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
- public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
public static final boolean DEFAULT_TCP_NO_DELAY = true;
public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
- public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
public static final boolean DEFAULT_TCP_NO_DELAY = true;
protected int maxKeepAliveRequests = -1;
/**
- * The number of seconds Tomcat will wait for a subsequent request
- * before closing the connection.
- */
- protected int keepAliveTimeout = 15000;
-
- /**
* SSL enabled ?
*/
protected boolean ssl = false;
}
/**
- * Set the Keep-Alive timeout.
- */
- public void setKeepAliveTimeout(int timeout) {
- keepAliveTimeout = timeout;
- }
-
-
- /**
- * Return the number Keep-Alive timeout.
- */
- public int getKeepAliveTimeout() {
- return keepAliveTimeout;
- }
-
- /**
* Set the maximum size of a POST which will be buffered in SSL mode.
*/
public void setMaxSavePostSize(int msps) {
cHandler = new Http11ConnectionHandler( this );
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
+ setKeepAliveTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
//setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
}
*/
protected int maxKeepAliveRequests = -1;
- /**
- * The number of seconds Tomcat will wait for a subsequent request
- * before closing the connection.
- */
- protected int keepAliveTimeout = 15000;
-
/**
* SSL information.
}
/**
- * Set the Keep-Alive timeout.
- */
- public void setKeepAliveTimeout(int timeout) {
- keepAliveTimeout = timeout;
- }
-
-
- /**
- * Return the number Keep-Alive timeout.
- */
- public int getKeepAliveTimeout() {
- return keepAliveTimeout;
- }
-
-
- /**
* Set the maximum size of a POST which will be buffered in SSL mode.
*/
public void setMaxSavePostSize(int msps) {
// Parsing the request header
try {
- if (!disableUploadTimeout && keptAlive) {
- if (keepAliveTimeout > 0) {
- socket.setSoTimeout(keepAliveTimeout);
- }
- else if (soTimeout > 0) {
- socket.setSoTimeout(soTimeout);
- }
+ if( !disableUploadTimeout && keptAlive && soTimeout > 0 ) {
+ socket.setSoTimeout(soTimeout);
}
inputBuffer.parseRequestLine();
request.setStartTime(System.currentTimeMillis());
public Http11Protocol() {
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
- setKeepAliveTimeout(Constants.DEFAULT_KEEPALIVE_TIMEOUT);
//setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
}
// HTTP
/**
- * The number of seconds Tomcat will wait for a subsequent request
- * before closing the connection. The default is the same as for
- * Apache HTTP Server (15 000 milliseconds).
- */
- protected int keepAliveTimeout = 15000;
- public int getKeepAliveTimeout() { return keepAliveTimeout; }
- public void setKeepAliveTimeout(int timeout) { keepAliveTimeout = timeout; }
-
-
- // HTTP
- /**
* This timeout represents the socket timeout which will be used while
* the adapter execution is in progress, unless disableUploadTimeout
* is set to true. The default is the same as for Apache HTTP Server
new Http11Processor(protocol.maxHttpHeaderSize, protocol.endpoint);
processor.setAdapter(protocol.adapter);
processor.setMaxKeepAliveRequests(protocol.maxKeepAliveRequests);
- processor.setKeepAliveTimeout(protocol.keepAliveTimeout);
processor.setTimeout(protocol.timeout);
processor.setDisableUploadTimeout(protocol.disableUploadTimeout);
processor.setCompression(protocol.compression);
/**
* Keep-Alive timeout.
*/
- protected int keepAliveTimeout = 15000;
+ protected int keepAliveTimeout = -1;
public int getKeepAliveTimeout() { return keepAliveTimeout; }
public void setKeepAliveTimeout(int timeout) { keepAliveTimeout = timeout; }
protected void init() {
pool = Pool.create(serverSockPool);
int size = sendfileSize / sendfileThreadCount;
- sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+ sendfilePollset = allocatePoller(size, pool, soTimeout);
if (sendfilePollset == 0 && size > 1024) {
size = 1024;
- sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+ sendfilePollset = allocatePoller(size, pool, soTimeout);
}
if (sendfilePollset == 0) {
size = 62;
- sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+ sendfilePollset = allocatePoller(size, pool, soTimeout);
}
desc = new long[size * 2];
sendfileData = new HashMap<Long, SendfileData>(size);