开发者

What delegate method is called when an ASI-HTTP-Request times out?

I have an app that uses ASI-HTTP-Request for large files, and I had a tester recently note that they wer observing very long loading delays that s开发者_如何转开发hould be manifesting as timeouts. I have delegate methods wired up for request failures, but these didn't seem to be happening.

I poured through their documentation but didn't see anything specific.


In ASIHTTPRequest.m, look in the -checkRequestStatus method.

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

[self failWithError:ASIRequestTimedOutError];

So you should be able to check the error returned in the delegate's -requestFailed: method:

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

It's a good idea to read through the source to get a rough feel for how things work. The documentation is great, but not always in sync with the source code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜