Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the default timeout of using HttpGet and DefaultHttpClient?

Tags:

java

android

The code is like below. If I don't set any timeout parameters, what is the default time out for "new DefaultHttpClient().execute(mConnection)"?

mConnection = new HttpGet(mURL);
mResponse = new DefaultHttpClient().execute(mConnection);

Thanks.

like image 480
Kai Avatar asked Sep 11 '10 21:09

Kai


People also ask

What is a good HTTP timeout?

Knowing the time available to provide a response can avoid problems with timeouts. Current implementations select times between 30 and 120 seconds, times that have been empirically determined to be safe.

What is the difference between connection timeout and connection request timeout?

request timeout — a time period required to process an HTTP call: from sending a request to receiving a response. connection timeout — a time period in which a client should establish a connection with a server. socket timeout — a maximum time of inactivity between two data packets when exchanging data with a server.


1 Answers

The default connection timeout is around 60-70 seconds depending on the platform. The default read timeout is infinity.

like image 149
user207421 Avatar answered Oct 19 '22 06:10

user207421