什么是AFNetworking 2等同于ASIHTTPRequest setMaxConcurrentOperationCount [英] What is the AFNetworking 2 equivalent to ASIHTTPRequest setMaxConcurrentOperationCount

查看:311
本文介绍了什么是AFNetworking 2等同于ASIHTTPRequest setMaxConcurrentOperationCount的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图限制最大连接但无法找到该方法。有谁知道怎么做?

I was trying to limit the max connections but couldn't find the method. Does anyone know how to do this?

推荐答案

你想要做的是设置自定义 NSURLSessionConfiguration 通过使用 initWithSessionConfiguration创建您自己的 AFURLSessionManager

Probably what you want to do is to set a custom NSURLSessionConfiguration by creating your own AFURLSessionManager with initWithSessionConfiguration:.

会话配置允许您设置 HTTPMaximumConnectionsPerHost

如果您正在使用 AFHTTPRequestOperationManager 然后你可以获得 operationQueue 并设置 maxConcurrentOperationCount 它。

If you're using AFHTTPRequestOperationManager then you can get its operationQueue and set maxConcurrentOperationCount on it.

这篇关于什么是AFNetworking 2等同于ASIHTTPRequest setMaxConcurrentOperationCount的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆