hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hakan.jacobsson" <hakan.jacobs...@aftonbladet.se>
Subject Timeout settings not working properly
Date Mon, 19 Jan 2009 10:39:46 GMT

I'm using HttpClient 3.1 to connect to a server.
I've set both the connection timeout and the socket timeout.
I set the connection timeout in the HttpConnectionManager (later set  
in HttpClient) like this:


			MultiThreadedHttpConnectionManager cm = new  
			//connection timeout - same value as for socket timeout (set in  
the PostMethod - see below))
			//set HttpConnectionManager in HttpClient


I set the sockettimeout in the PostMethod class like this:

			//retry and socket timeout settings (result = an instance of  
new DefaultHttpMethodRetryHandler(1, false));
			//socket timeout (connection timeout already set in HttpClient)


At times (when the server we connect to is slow on response?) the  
requests still wait for a much longer time than the timeout we use  
(500 ms).
A SocketTimeout/ConnectionTimeout-exception is thrown, but this might  
take a very long time (48 seconds is a recent example). We measure  
the time in
our code.

Any idea what might cause this problem?

/best regards, HÃ¥kan Jacobsson, System developer in Stockholm, Sweden.
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message