iOS Question httpjob request timeout error

sutipunW

New Member
Licensed User
I am trying to convert my B4A project to B4I. But I face a problem that I cannot set request timeout for iHttpUtils2. It is compiled OK both on local and Hosted Builder.
But when run it caused error as attached. What should I do since Client's Server is a little bit slow?
2020-03-21_2-05-25.png







/
 

Mike1970

Well-Known Member
Licensed User
Longtime User
Dear Semen, that's what I'm doing. Pls. see attached. The one without job.GetRequest.Timeoout = no runtime error. But with the requested will cause error.
i have the same problem but I ignored it for the moment by comment that line.
I'm interested in the solution too
 
Upvote 0

sutipunW

New Member
Licensed User
I tried a timeout in B4i 6.50. Log file looks so.
I'm also using B4i 6.50. I've tried your test.zip without error. So I Try to duplicate your work but the error is still there. So now I'm confused and lost.
I have attached my test project and Logs screen.
 

Attachments

  • testHttpUtils.zip
    6.9 KB · Views: 202
  • 2020-03-21_23-19-59.png
    2020-03-21_23-19-59.png
    153.1 KB · Views: 205
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
At first job.Download("..."). Then job.GetRequest.Timeout = ...

If you set Timeout before Download, GetRequest does following
B4X:
Public Sub GetRequest As HttpRequest
    Return req
End Sub

In this moment req is not initialized yet (so GetRequest.Timeout gives an error).

Exactly Download initializes req and should be first.
B4X:
Public Sub Download(Link As String)
    req.InitializeGet(Link)
    CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me)
End Sub

I understand, why you want to correct request at first. But really it's not important. Download will not start before Wait For.
 
Last edited:
Upvote 0
Top