R riko Member Licensed User Longtime User Oct 3, 2012 #1 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: Code: 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.
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: Code: 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.
R riko Member Licensed User Longtime User Oct 4, 2012 #2 here is my service code... Attachments uploaderService.zip uploaderService.zip 2.6 KB · Views: 480 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 4, 2012 #3 The timeout will only be fired if data is not being sent or received. If the upload is very slow then it will not fire. Upvote 0
The timeout will only be fired if data is not being sent or received. If the upload is very slow then it will not fire.
R riko Member Licensed User Longtime User Oct 4, 2012 #4 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
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.