Hi Guys,
Is there a best practice in terms of getting your app to re-try a remote server call in the event of bad connectivity or timeout?
I have a generic function that handles all my remote calls;
function doQuery(url) { var xhr = Ti.Network.createHTTPClient({ onload: function(e) { if(xhr.responseText != '0') { handleResponse(xhr.responseText); // Success } }, onerror: function(e) { // Failure... Can I call myself again? settimeout doQuery(url) ? }, timeout:5000 }); xhr.open("GET", url); xhr.send(); }