Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A reliable HTTP library for .Net 2.0 [closed]

Tags:

.net

http

timeout

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

like image 604
ripper234 Avatar asked Nov 05 '22 23:11

ripper234


1 Answers

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

like image 88
ripper234 Avatar answered Nov 11 '22 06:11

ripper234