473,322 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

HttpWebRequest Timeout problem in DNS resolution

In the doc http://msdn2.microsoft.com/en-us/lib...t.timeout.aspx,
it reads,
"A Domain Name System (DNS) query may take up to 15 seconds to return
or time out. If your request contains a host name that requires
resolution and you set Timeout to a value less than 15 seconds, it may
take 15 seconds or more before a WebException is thrown to indicate a
timeout on your request."

The words doesn't appear in .Net 1.1 doc, only apppears since 2.0. Our
system is migrating from 1.1 to 2.0. Unfortunately, we met such issue,
since DNS servier is different in in dev & test environment, it is not
discovered till production release.

For non-exist domain like "www.abcdefaj12343jdafad.abd",
HttpWebRequest.GetResponse() doesn't return after 20 seconds hang,
even we set timeout 5 seconds to HttpWebRequest.Timeout.

This is un-tolerable. My current solution is to use
Dns.BeginGetHostEntry like asynchronous method to detect DNS with 1
second timeout, if it doesn't get result successfuly in 1 second. The
code doesn't proceed to call HttpWebRequest.GetResponse().

I know there is HttpWebRequest.BeginGetResponse(), but i don't want a
non-existent domain cost 5 seconds delay in crawling.

Anyone has any better idea?
Is it possible to config the DNS timeout without code change?
And, I really don't understand why .Net 2.0 bring such limitation.

Thanks.

Jun 12 '07 #1
0 5086

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jerry Rhodes | last post by:
When I run the code below, the web server tells me that I need to enable cookies. Can anyone tell me what might be causing that? I'm trying to POST userid and password to their login web page. ...
8
by: Soeren S. Joergensen | last post by:
Hi, From a win-service I do a HttpWebRequest to a secure url with some parameters to get some simple data from a remote system used later on in a worker thread. When making the request from...
1
by: Jeff B | last post by:
I'm trying to create a simple screen scraping application and I kept getting a System.Net.WebException thrown back with a message of "The operation has timed-out." At first I thought it was some...
11
by: Keith Patrick | last post by:
Could someone explain to me the relationship between these two classes? I am ripping my hair out trying to divert an HttpRequest to a new location via an HttpWebRequest, but I cannot get my...
1
by: davvel | last post by:
It has been 6 days of re-writing the same code in different ways to try and avoid a getResponse Timeout which haunted me for much too long now. I am trying to do a very simple thing which is...
1
by: Brett | last post by:
I'm checking a URL and logging the results returned from the server. One problem is when a site ask for cookies, my code times out. For example, this link does:...
2
by: GHS | last post by:
I have some code to connect to a website and pull some content out of the HTML. I've verified that the 2 URLs I'm using are perfectly fine in Internet Explorer and both of them return results...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
0
by: joshblair | last post by:
Hello, I am trying to post XML documents to a third party using the HttpWebRequest. This URL uses HTTPS (SSL) but I don't have a client certificate to deal with. Apparently they are using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.