HTTP and timeouts
HTTP and timeouts
HTTP and timeouts
HTTP and timeouts
HTTP and timeouts
HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts
HTTP and timeouts HTTP and timeouts
HTTP and timeouts
Go Back  Xtreme Visual Basic Talk > > > HTTP and timeouts


Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2011, 07:11 PM
karnival8 karnival8 is offline
Newcomer
 
Join Date: Jul 2011
Posts: 1
Default HTTP and timeouts


I am really new to VB and I finished my code for the project I was working on. There is one small big I need to fix and I can't figure it out for the life of me. My app contacts a web server every few hours to get data. If that site is down the app crashes.

If the request times-out, I would like the app to do something like a goto. How in the world can I do that? Here is the problem code:

updateurl = "http://someurl.com"
Set oHTTP = CreateObject("winhttp.winhttprequest.5.1")
oHTTP.SetTimeouts 3000, 3000, 3000, 3000
oHTTP.Open "GET", updateurl
oHTTP.Send oData
blah = oHTTP.ResponseText

would like to add "if oHTTP.Open takes too long, GoTo timeout
timeout:
MsgBox ("the attempt timed-out")

how in the world can i do this so my app doesn't crash if we restart the server?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
HTTP and timeouts
HTTP and timeouts
HTTP and timeouts HTTP and timeouts
HTTP and timeouts
HTTP and timeouts
HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts HTTP and timeouts
HTTP and timeouts
HTTP and timeouts
 
HTTP and timeouts
HTTP and timeouts
 
-->