On Android 2.1/2.2 I use DefaultHttpClient
found in Android SDK.
Apache says in their docs there are 2 timeouts:
CoreConnectionPNames.SO_TIMEOUT='http.socket.timeout': 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. This parameter expects a value of type java.lang.Integer. If this parameter is not set, read operations will not time out (infinite timeout).
CoreConnectionPNames.CONNECTION_TIMEOUT='http.connection.timeout': determines the timeout in milliseconds until a connection is established. A timeout value of zero is interpreted as an infinite timeout. This parameter expects a value of type java.lang.Integer. If this parameter is not set, connect operations will not time out (infinite timeout).
I tried searching Android sources for default values for these 2 timeouts, but was unable to find. Does anyone know what are the default values for these timeouts? I'd like to get a link to sources where the values are set or an official doc on this (versus just to hear an opinion).
Just try below below code section:
It works on my device:
Wouldn't you be able to get the default (or whatever values are set) using something like the following:
It's worth a shot if you really want to know what the default values are (as opposed to just setting the values yourself).