Which delegate method is called when the ASI-HTTP request timed out?

I have an application that uses ASI-HTTP-Request for large files, and recently I had a tester that noticed that they observed very long download delays, which should appear as timeouts. I have delegation methods for query failures, but they don't seem to be happening.

I poured their documentation, but did not see anything specific.

+4
source share
1 answer

In ASIHTTPRequest.m find the -checkRequestStatus method.

When a timeout occurs, the request fails with type ASIRequestTimedOutError :

 [self failWithError:ASIRequestTimedOutError]; 

Thus, you should be able to check for the error returned in the delegate method -requestFailed: ::

 - (void)requestFailed:(ASIHTTPRequest *)request { NSLog(@"Error: %@",[[request error] localizedDescription]); } 

It’s a good idea to read the source to understand how everything works. The documentation is great, but not always in sync with the source code.

+9
source

All Articles