tags:

views:

179

answers:

3

.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?

+1  A: 

Chilkat has a HTTP Component. I've never used it, but I have been impressed with some of their other components.

Ian Nelson
+3  A: 

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).

ripper234
+1  A: 

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.

Joel Coehoorn