当 ASI-HTTP-Request 超时时,会调用什么委托方法?
我有一个使用 ASI-HTTP-Request 处理大文件的应用程序,最近有一位测试人员注意到他们观察到很长的加载延迟,这应该表现为超时。我已经为请求失败连接了委托方法,但这些似乎没有发生。
我仔细阅读了他们的文档,但没有看到任何具体内容。
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 should 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
ASIHTTPRequest.m
中,查看-checkRequestStatus
方法。发生超时时,请求会失败并显示
ASIRequestTimedOutError
错误类型:因此您应该能够检查委托的
-requestFailed:
方法中返回的错误:这是一个好主意通读源代码以粗略地了解事情是如何工作的。文档很棒,但并不总是与源代码同步。
In
ASIHTTPRequest.m
, look in the-checkRequestStatus
method.When a timeout occurs, the request fails with an
ASIRequestTimedOutError
error type:So you should be able to check the error returned in the delegate's
-requestFailed:
method: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.