473,804 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.abcdefaj12 343jdafad.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.BeginGetHos tEntry 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. BeginGetRespons e(), 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 5149

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

Similar topics

3
4114
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. Thanks! Dim CookieJar As CookieContainer = New CookieContainer() Dim WebReq As HttpWebRequest Dim WebResp As HttpWebResponse Dim StrmRdr As StreamReader Dim StrmWrtr As StreamWriter Dim PostParms As String
8
11087
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 my code it takes about 10-12 secs to complete, but doing same request in my browser takes less than 1 sec. Can anyone explain this delay from within my code ??
1
12613
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 kind of connectivity issue on the machine. It didn't make sense though, because I can open up a browser on the same machine and easily browse the web. I'm stumped. I looked over my code for any errors and just couldn't find what I was doing...
11
15898
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 session xfer to work, possibly due to the cookies not being compatible. I've spent over a week trying to get the HWR to integrate nicely with my app, but I cannot get the session to transfer, and it'd probably take me even longer if I tried to digest...
1
2794
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 prooving the most difficult in my career. Scrape a screen which has several session variables within it, and send this page to an e-mail. I have two pages in my application webform1.aspx and webform2.aspx, in webform1.aspx I set several session...
1
1762
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: http://publications.mediapost.com/index.cfm?fuseaction=Articles.san&s=291719&Nid=12097&p=261023 A cookie prompt causes the following code to timeout and jump into the catch. This causes me to miss providing values to those variables after the "Dim wResp" line. How can I make use...
2
9697
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 "pretty quickly". The first URL I try takes a while but eventually comes back with the correct results. It took *much longer* than in Internet Explorer. The second URL times out even if I increase the timeout value significantly. Internet explorer...
4
12717
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 advices but still having troubles... it might some obvious error that I am making but I just dont see it. ==================FIRST - Webclient=================================
0
2589
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 WebMethods as the platform that receives these postings. I don't have any experience with that technology. The sample below is the from test app that I put together to post the XML (cXML Order Requests) documents. These documents, at least my
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10594
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10087
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.