The connection does not timeout while downloading file from internet

后端 未结 4 698
再見小時候
再見小時候 2020-12-07 04:30

Related to a post of mine ( How to retrieve a file from Internet via HTTP? ) about how to easily and robustly download a file from Internet, I have found a possible solution

4条回答
  •  遥遥无期
    2020-12-07 05:03

    Are you sure that you aren't hitting the INTERNET_OPTION_CONNECT_TIMEOUT? It will try to connect first, then receive.

    In order to test the connect timeout, it must resolve, but never connect. In order to test the read timeout, it must connect, but never receive any data.

    I generally set my connect timeout to 10 seconds, and the read timeout to 30 seconds. Anything longer than that, I consider down anyway.

提交回复
热议问题