Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default timeout for HttpComponent Client

Tags:

I can't find any documentation on the default httpParams for httpclient 4.1 ?

What's the default socket timeout when I do a GET ?

like image 992
thinkanotherone Avatar asked Mar 16 '12 09:03

thinkanotherone


People also ask

What is the default timeout for RestTemplate?

The default timeout is infinite. By default RestTemplate uses SimpleClientHttpRequestFactory and that in turn uses HttpURLConnection.

What is connection timeout in HttpClient?

timeout) – the time waiting for data – after establishing the connection; maximum time of inactivity between two data packets. the Connection Manager Timeout (http. connection-manager. timeout) – the time to wait for a connection from the connection manager/pool.

What is the default timeout for HTTP request in Java?

The Request Timeout property specifies the number of seconds the server waits between accepting a connection to a client and receiving information from it. The default setting is 30 seconds.

What is HTTP read timeout?

The HTTP read timeout determines how long the IBM® IoT MessageSight Web UI waits before it times out when it is waiting for an HTTP read request to complete. By default, this value is set to 20 seconds. If you have a slow connection, it is possible that your HTTP read request cannot complete within 20 seconds.


2 Answers

According to the documentation, the http.socket.timeout parameter controls the SO_TIMEOUT value, and:

If this parameter is not set, read operations will not time out (infinite timeout).

like image 163
beny23 Avatar answered Oct 21 '22 22:10

beny23


The accepted answer is not applicable for newer versions of HttpClient. Versions 4.3.X and above use the system default which is usually 60 secs.

Taken from HttpClient javadoc.

public int getSocketTimeout() Defines the socket timeout (SO_TIMEOUT) in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets). A timeout value of zero is interpreted as an infinite timeout. A negative value is interpreted as undefined (system default).  Default: -1 
like image 26
Chandru Avatar answered Oct 21 '22 23:10

Chandru