XHR timeout when using 3G, fine via WiFi
Yes, I know that makes no sense. LOL
Since installing iOS 4 onto my 3GS my apps can only make XHR calls when the iPhone is connected via wifi. When the same app on the same phone is opened on a 3G connection, xhr.onerror is triggered and this is the message I see:
error = "Error Domain=ASIHTTPRequestErrorDomain Code=2\"The request timed out\" UserInfo=0x37d2e0 {NSLocalizedDescription=The request timed out}"; source=[object TiNetworkClient];
Any ideas? This has killed both of my published apps. Changing Ti SDK versions doesn't make any difference.
5 Answers
-
I know how to fix it. HttpClient triggers a false timeout on slower networks (yes it does!!!).
I was getting the same error on the old slow iphone. There is something in the underlying class of the HttpClient, that the code which is supposed to fix the false timeout, doesnt work.The solution is remove the timeout at all, like this:
xhr.setTimeout(0);
Then it will work, although sometimes verrrrrry slooooowwwww
-
It sounds like either a DNS lookup or an interface issue.
Does the problem occur if you use the IP address or when you use the DNS name? -
duplicate
-
Still trying to get things working again but it does look like this is result of an iOS 4 upgrade problem and nothing to do with Titanium.
Here's some info in case anyone else runs into the same sort of thing:
http://discussions.apple.com/thread.jspa?threadID=2469607&tstart=0
-
Hi, I had the same problem using 3g.
What i did after trying for hours was to disable the 3g , using the edge and finally re-enable 3g.
this worked for me still now. Hope can help.