Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

HttpWebRequest Timeout

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.
  • 2
1 Solution
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/
stengeljAuthor Commented:
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:

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
stengeljAuthor Commented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now