A reliable HTTP library for .Net 2.0 [closed]
Question
.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?
Solution
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).
OTHER TIPS
Chilkat has a HTTP Component. I've never used it, but I have been impressed with some of their other components.
See the HttpWebRequest.BeginGetResponse() method. Not exactly what you asked for, it's been a few days since you've had any other responses and it deserves a mention.