But it's used to download screenshots, files and information. I must be able to do something when there's no connection (put a filler screenshot image, stop the download and show an error message).
I really need to have a timeout. Maybe using timers? :sign0085: Is there any way to stop a response call? I would stop the call after 5 seconds using a timer's tick event.
Currently it is not possible to cancel the request. However you can use a timer to test if the response event was not fired after 30 or 60 seconds (5 seconds is not enough) show an error message and later ignore the response event if it will fire.
Sub Globals
ignoreResponse = false
End Sub
Sub App_Start
Form1.Show
request.New1(URL)
response.New1
request.GetAsyncResponse
ignoreResponse = false
Timer1.Enabled = true 'interval = 30000
End Sub
Sub Timer1_Tick
Timer1.Enabled = false
ignoreRequest = true
msgbox("Error connecting to site.")
End Sub
Sub request_Response
if ignoreRequest then return
...
End Sub