I got the source code to check the functionality for timeout and I see that
this is not used in the code. What is the impact of this NOT being used in
the code? Help appreciated. Thanks
/**
* This method always returns the same connection object. If the
connection is already
* open, it will be closed and the new host configuration will be
applied.
*
* @param hostConfiguration The host configuration specifying the
connection
* details.
* @param timeout this parameter has no effect. The connection is always
returned
* immediately.
* @since 3.0
*/
public HttpConnection getConnectionWithTimeout(
HostConfiguration hostConfiguration, long timeout) {
if (httpConnection == null) {
httpConnection = new HttpConnection(hostConfiguration);
httpConnection.setHttpConnectionManager(this);
httpConnection.getParams().setDefaults(this.params);
} else {
// make sure the host and proxy are correct for this connection
// close it and set the values if they are not
if (!hostConfiguration.hostEquals(httpConnection)
|| !hostConfiguration.proxyEquals(httpConnection)) {
if (httpConnection.isOpen()) {
httpConnection.close();
}
httpConnection.setHost(hostConfiguration.getHost());
httpConnection.setPort(hostConfiguration.getPort());
httpConnection.setProtocol(hostConfiguration.getProtocol());
httpConnection.setLocalAddress(hostConfiguration.getLocalAddress());
httpConnection.setProxyHost(hostConfiguration.getProxyHost());
httpConnection.setProxyPort(hostConfiguration.getProxyPort());
} else {
finishLastResponse(httpConnection);
}
}
// remove the connection from the timeout handler
idleStartTime = Long.MAX_VALUE;
if (inUse) LOG.warn(MISUSE_MESSAGE);
inUse = true;
return httpConnection;
}
--
View this message in context:
http://www.nabble.com/Timeout-input-parameter-not-used-in-getConnectionWithTimeout-method-tp21222106p21222106.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]