Why HttpRequest Timeout does not work?

riko

Member
Licensed User
Longtime User
Hello,

i have a strange issue with my app when i am uploading big amount (400KB, photo data from camera) of data with HttpUtils library to my https server.

I am doing the following in a service-module:

B4X:
Dim hc As HttpClient
Dim req As HttpRequest
...
hc.InitializeAcceptAll("hc")
... prepare my PostBytes ...
req.InitializePost2(url, PostBytes)
req.Timeout = 10000
hc.Execute(req, 1)
But my ResponseSuccess and ResponseError Sub's are not called within the 10 seconds of the timeout.
It takes sometimes several minutes (you can easily go for a cup of coffee) to get the ResponseSuccess-Sub to be triggered, and also to get this request on my web-server. There are few times where it is sent immediately...

But in the meantime other requests from this app receives into my web-server without any time delay!

Any idea why this can happen or the timeout does not work?
Are there any restrictions in concurrent HttpClients working (i have 2 services and one for "on demand" requests. One service is "pinging" all 2 seconds to my server to keep the line, the other service is the photo uploader)?

Glad for any help with this?

Thanks Richard.
 

riko

Member
Licensed User
Longtime User
Ok, so far i have figured out what most likely caused the problem.
The device does frequently switching between Netmode (3G <-> H+)...

So i switched from auto-selecting the transponder of the mobil-net to fixed GSM.
After that i had no such problems (or only very very less) anymore...:)

richard.
 
Upvote 0
Top