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







/
 
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
At first job.Download("..."). Then job.GetRequest.Timeout = ...

If you set Timeout before Download, GetRequest does following
Code: Copy
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.
Code: Copy
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
Back
Top