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        

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

      End Try

End sub

Thank you.
LVL 9
stengeljAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cb1393Commented:
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/
0
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:

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21367300.html
0
Sukamal_SenguptaCommented:
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.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebrequestclasstimeouttopic.asp

http://support.microsoft.com/?kbid=831138 

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.

Thanks,
Sukamal Sengupta
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.