您的位置:首页 > 产品设计 > UI/UE

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属性
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: