.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that HttpWebResponse.GetResponse()
with ReadTimeout and Timeout set to 5000 blocks for about 20 seconds before failing (the problem is it should fail after 5 seconds, but it actually takes 20 seconds).
I need a library with better protocol conformance and timeout control. Know any?
According to Microsoft, what could be hanging is possibly the DNS resolution, which may take up to 15 seconds.
Solution - do the DNS resolving on your own (Dns.BeginGetHostByName).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With