I want to detect a timeout with httpjob.
I'm doing this:
When I start my app without internet connection, I thought the "failed" message would be shown after 5 seconds. But nothing happens. It seems that Android is trying to do the PostString and "hangs" on that line. What am I doing wrong?
I'm doing this:
B4X:
Dim Job1 As HttpJob
Job1.Initialize(...)
Job1.Poststring(...)
Job1.GetRequest.Timeout =5000 ' 5 seconds
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log("succes")
Else
Log("failed")
End If
When I start my app without internet connection, I thought the "failed" message would be shown after 5 seconds. But nothing happens. It seems that Android is trying to do the PostString and "hangs" on that line. What am I doing wrong?