What is the AFNetworking 2 equivalent to ASIHTTPRequest setMaxConcurrentOperationCount

∥☆過路亽.° 提交于 2019-12-25 01:54:14

问题


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


回答1:


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

The session configuration allows you to set HTTPMaximumConnectionsPerHost.

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



来源:https://stackoverflow.com/questions/22596652/what-is-the-afnetworking-2-equivalent-to-asihttprequest-setmaxconcurrentoperatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!