Receiving request timeout even though connect timeout and read timeout is set to default (infinite)?

后端 未结 3 1793
Happy的楠姐
Happy的楠姐 2021-01-25 04:47

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

3条回答
  •  孤城傲影
    2021-01-25 05:26

    The Javadoc for connect() is incorrect. Zero gives you the platform connect timeout, which is not infinite, but around a minute. You can only decrease this value with the timeout parameter to connect(), not increase it.

提交回复
热议问题