问题
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