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
If the getConnectTimeout
and getReadTimeout
from the object return zero, then that does indeed mean infinity. This is inherited from the underlying URLConnection
class.
It may be that the exception you're receiving is not a SocketTimeoutException
at all, you should verify this - it's possible to get IOException
thrown regardless of the timeout settings.