more time-out properties for http connection manager

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6912 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 1610c81dff
commit c71d829bb5

@ -134,6 +134,9 @@ public class Client {
localHostConfiguration.setHost("127.0.0.1");
conManager.getParams().setMaxConnectionsPerHost(localHostConfiguration, 100);
conManager.getParams().setReceiveBufferSize(16 * 1024 * 1024); // set this high to avoid storage in temporary files
conManager.getParams().setStaleCheckingEnabled(true);
conManager.getParams().setSoTimeout(30000);
conManager.getParams().setTcpNoDelay(true); // there is enough bandwith these days
apacheHttpClient = new HttpClient(conManager);
// only one retry
@ -200,12 +203,11 @@ public class Client {
* (non-Javadoc)
* @see de.anomic.http.HttpClient#setTimeout(int)
*/
@SuppressWarnings("deprecation")
public void setTimeout(final int timeout) {
apacheHttpClient.getParams().setIntParameter(HttpMethodParams.SO_TIMEOUT, timeout);
apacheHttpClient.getParams().setIntParameter(HttpMethodParams.HEAD_BODY_CHECK_TIMEOUT, timeout);
apacheHttpClient.setConnectionTimeout(timeout);
apacheHttpClient.setTimeout(60000);
conManager.getParams().setConnectionTimeout(timeout);
conManager.getParams().setSoTimeout(timeout);
}
/**

Loading…
Cancel
Save