webrequest.begingetresponse is taking too much time when the url is invalid

后端 未结 2 1589
渐次进展
渐次进展 2021-01-16 09:59

I am using webrequest to fetch some image data. The url may be invaild sometime. In case of invalid URL, begingetresponse is taking time equals to timeout period. Also the c

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 10:05

    looks like this is an issue with .NET. BeginGetResponse blocks until DNS is resolved. In case of wrong URL (like http://somecrap) it tries until it gets timeout. See the following links - link1 and link2

提交回复
热议问题