I am accessing a web page with a .php script. I am testing with the server up and down. If it is down my app will go into offline mode but it would need to know it is down in as short amount of time as possible.
Sub DoTheComms(xString) As String
Dim xLine As String
WaitCursor(True)
hostRequest.New1("http://" & SysHostAddress &"/" & xString)
hostResponse.New1
hostRequest.TimeOut = 60000
ErrorLabel(OfflineMode)
hostResponse.Value = hostRequest.GetResponse
xLine = hostResponse.GetString
hostResponse.Close
WaitCursor(False)
Return xLine
OfflineMode:
WaitCursor(False)
Return "*OLM*"
End Sub
When I take the ErrorLabel out the error msg comes in 7 seconds on the desktop and is:
An error occurred on sub main.dothecomms
Line number: 255
hostResponse.Value = hostRequest.GetResponse
Error Description:
Response Code: -1
ConnectFailure
Continue?
YES/NO
When I add the ErrorLabel - the code is processed within 5 seconds.
that is on the desktop
on the device with the ErrorLabel the code is processed in 60 seconds (the set time out value)
It seems to me that the error is detected early on the desktop but takes quite a bit longer on the device. Any suggestions on how to get this error earlier?