Android Question job1.getRequest.TimeOut question

davelt99

Member
Licensed User
Longtime User
If there is limited wi-fi and the timeout period expires as in:

B4X:
     Job1.Initialize("Job1",Me)
     Job1.PostString(sURL,"")
     Job1.GetRequest.Timeout=5000

Which Job1 event occurs next ?

Thank you,
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

davelt99

Member
Licensed User
Longtime User
The above Job1 code is part of the sub "LoadLayoutToPanel".

With wi-fi turned off, immediately after the
B4X:
  Job1.GetRequest.Timeout=5000
the code goes to
B4X:
 End Sub
and never gets to JobDone.

Seems like the timeout is not being implemented.



If there is no wi-fi and the timeout has expired then the code only
 
Upvote 0

davelt99

Member
Licensed User
Longtime User
Did further testing and without wi-fi the following code:

B4X:
                  ProgressDialogShow("Validating This Device...")
                  Job1.Initialize("Job1",Me)
                  Job1.PostString(sURL,"")
                  Job1.GetRequest.Timeout=5000

never gets to JobDone.

With wi-fi enabled, JobDone is raised within 3 seconds
 
Upvote 0

davelt99

Member
Licensed User
Longtime User
Thanks for the suggestion.

Using HttpUtils2 version 2.10 and Okhttp version 1.00

Rewrote using a DIM immediately before posting the string

B4X:
          Dim job2 As HttpJob
          ProgressDialogShow("Validating This Device...")
          job2.Initialize("job2",Me)
          job2.PostString(sURL,"")
          job2.GetRequest.Timeout=5000

Still never gets to:

B4X:
Sub JobDone (job As HttpJob)
   If job.Success = True
 
Upvote 0
Top