afnetwork 又一个坑“The request timed out”
2016-04-01 11:31
363 查看
使用afn连续多个网络请求会出现错乱
比如for循环中连续请求,导致本来抓包已经正确返回数据的请求收到的确实error, 在urlconnection中
- (void)connection:(NSURLConnection __unused *)connection
didFailWithError:(NSError *)error
{
self.error = error;
[self.outputStream close];
if (self.responseData)
{
self.outputStream = nil;
}
self.connection = nil;
[self finish];
}
error报错为The request timed out
解决:
超时时间设置更长一些...
timeout属性
比如for循环中连续请求,导致本来抓包已经正确返回数据的请求收到的确实error, 在urlconnection中
- (void)connection:(NSURLConnection __unused *)connection
didFailWithError:(NSError *)error
{
self.error = error;
[self.outputStream close];
if (self.responseData)
{
self.outputStream = nil;
}
self.connection = nil;
[self finish];
}
error报错为The request timed out
解决:
超时时间设置更长一些...
timeout属性
相关文章推荐
- EasyUi combotree 实现动态加载树节点
- php require和include区别
- UITableview性能优化总结
- datatables(1.10.10+)+模块化请求(require.js or others)
- EasyUi中的Combogrid 实现分页和动态搜索远程数据
- currval of sequence "follow_id_seq" is not yet defined in this session
- UIAlertController 使用
- 在ofbiz框架里面对request里面的值处理
- 简介EasyUI datagrid editor combogrid搜索框的实现
- 分析可变形字符串序列StringBuilder 以及 StringBuffer之默认大小与扩容
- 阻塞队列--LinkedBlockingQueue
- 阻塞队列BlockingQueue用法
- @PathParam 和 @QueryParam
- ServletAPI --- Request接口
- 封装OpenGL渲染为DLL,C#做UI显示
- UIPresentationController自定义转场动画
- javaweb项目中对于资源文件的读取(to be continue)
- RValue forward sample code
- easyUI单元格合并自定义封装
- Android总结 - System UI Mode