HttpWebRequest Timeout

Posted on 2005-03-28
Medium Priority
Last Modified: 2008-01-09
I am using the following function to verify a specific link on a page.  I want to extend the timeout period so I get fewer errors.  Can this be done? How?

sub CheckLink(ByVal MyUrl As String)

      Dim _request As System.Net.HttpWebRequest        
      Dim _response As System.Net.HttpWebResponse        

            _request = System.Net.WebRequest.Create(MyUrl)            
            _response = _request.GetResponse()            
      Catch ex As Exception
            LinkError(myUrl) 'creates error report

      End Try

End sub

Thank you.
Question by:stengelj
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 13646385
Is this ASP.net? If so, might try posting in the ASP.net topic area: http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/

Author Comment

ID: 13646702
Crap,  I didn't see I was in ASPonlyville.  I'll delete this questions an repost over in ASP.net.  I was wondering why nobody was helping me...

Thank you cb1393.  
Post anything to my new post and I give you some split points for steering me in the right directon if someone anwers my question:


Accepted Solution

Sukamal_Sengupta earned 500 total points
ID: 13651420
Hi stengelj ,

Combination of using both MSXML (through interop) and marking the ASP.NET pages which issue the requests with the ASPCOMPAT attribute. This causes the page to run on an STA thread instead of the default MTA.

I have had similar trouble with the WebRequest object. I found this article on Microsoft's website which was interesting.



Maybe not exactly the solution to your problem but a further indication that the WebRequest object needs some work as this issue appears to have cropped up in the .NET 2.0 BETA.

Sukamal Sengupta

Author Comment

ID: 13769011
I never saw your post here but, since I ended up somewhat using your MSXML suggestion based on feedback on a post I placed in the ASP.NET section and the KB article you provided was informative, I'll award you the points I have here.

Thank you.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question