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 on the Android phone? Or does Android/ Java has its own default value for the timeout?
When I try to get the value of my connect timeout (getConnectTimeout()) and read timeout (getReadTimeout()), it returns a value of 0 which I assume is the equivalent of infinity. However, even though their value is 0, there are times that I’m still receiving a request timeout error. So their value can’t be equal to infinity. Can someone enlighten me on this?
Did you do any research? The defaults are detailed in the documentation. Here’s the relevant parts:
Also there is this note on timeouts:
It might be possible that the server you are connecting to is timing out your client.