Getting The request timed out and The request was cancelled messages

375 views
Skip to first unread message

Shamil

unread,
Feb 19, 2012, 11:11:30 AM2/19/12
to asihttp...@googlegroups.com
Hello,

I am following an example which is provided on the ASIHTTPRequest website.

Most of the time, i end up going to the requestFail method, and i get the following error message ;

-- Error Domain=ASIHTTPRequestErrorDomain Code=4 "The request was cancelled" userInfo=0x243278 {NALocalizedDescription=The request was cancelled}

and at times i get the following error message too

-- Error Domain=ASIHTTPRequestErrorDomain Code=2 "The request timed out" userInfo=0x243278 {NALocalizedDescription= The request timed out }


Why am i getting this and how could i prevent this from happening ? (Or what should i do in this situation)


[self setNetworkQueue:[ASINetworkQueue queue]];
[[self networkQueue] setDelegate:self];


[[self networkQueue] setShouldCancelAllRequestsOnFailure:NO];
[[self networkQueue] setRequestDidFinishSelector:@selector(requestSuccess:)];


[[self networkQueue] setRequestDidFailSelector:@selector(requestFail:)];    
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://www.url.com/servoce"]];


[request setUseKeychainPersistence:YES];
[[self networkQueue] addOperation:request];    
[[self networkQueue] go];




Reply all
Reply to author
Forward
0 new messages