[AC-2785] Sporadic connection failure with HTTPClient.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-06-25T04:03:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | httpclient, iphone, mobile, onerror, xhr |
Reporter | Rob Marston |
Assignee | Tony Guntharp |
Created | 2011-06-13T14:04:47.000+0000 |
Updated | 2016-03-08T07:47:42.000+0000 |
Description
The following error is thrown approximately 75% of the time when requesting web service via HTTPClient:
Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0x6d14d80 {NSUnderlyingError=0x6d13ca0 "The operation couldn't be completed. (kCFErrorDomainCFNetwork error -1005.)", NSLocalizedDescription=A connection failure occurred}
Cannot resolve.
In order for us to progress this issue, please edit your ticket to include a proper [Use-case](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases). Also, please provide a link to the Q&A question where you have sought help from the community prior to raising this ticket. Kindly read the [Submitting Bug Reports](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports) guide for more info about this. Thank you
Apologies. The community post can be found at http://developer.appcelerator.com/question/120964/sporadic-server-error-a-connection-failure-occurred. Here's the use case: var curr_marble = {id:1); var list = {id:2025}; var user = {username:'USERNAME',password:'PASSWORD'}; var auth = 'Basic '+Titanium.Utils.base64encode(user.username+':'+user.password); var xhr = Titanium.Network.createHTTPClient(); xhr.setTimeout(0); xhr.onerror = function(e) { Titanium.API.info(e.error); }; xhr.onload = function() { Titanium.API.info(this.responseText); }; xhr.open("POST","http://api.marblejarapp.com/1/marbles.json"); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xhr.setRequestHeader('Authorization',auth); if (Titanium.Network.online) { xhr.send({marbletype:curr_marble.id,list:list.id}); } else { alert("Network unavailable, please try again."); }; *My username and password have been obfuscated for security purposes. Happy to send you actual login credentials. Originally I had though the sound (local mp3) that played before the HTTP request was initiated was causing the error but as it turns out it happens regardless. Additional examples and files available.
It seems the user has [found the answer](http://developer.appcelerator.com/question/120964/sporadic-server-error-a-connection-failure-occurred) but not updated this ticket. :/ The solution was:
Closing after 30 days of inactivity.