I am connecting to a web service and did not set any connect timeout and read timeout on HttpURLConnection. What is the default connect timeout and read timeout? Is it dependent
Did you do any research? The defaults are detailed in the documentation. Here's the relevant parts:
public void setConnectTimeout (int timeout) Since: API Level 1
Sets the timeout value in milliseconds for establishing the connection to the resource pointed by this URLConnection instance. A SocketTimeoutException is thrown if the connection could not be established in this time. Default is 0 which stands for an infinite timeout.
public void setReadTimeout (int timeout) Since: API Level 1
Sets the timeout value in milliseconds for reading from the input stream of an established connection to the resource. A SocketTimeoutException is thrown if the connection could not be established in this time. Default is 0 which stands for an infinite timeout.
Also there is this note on timeouts:
URLConnection supports two timeouts: a connect timeout and a read timeout. By default, operations never time out.
It might be possible that the server you are connecting to is timing out your client.