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

x
  • 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        

      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.
0
stengelj
Asked:
stengelj
  • 2
1 Solution
 
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
 
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

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