-(instancetype)initWithDataTaskWithUrlRequest:(NSURLRequest *)request WithIdentifierIndex:(NSString*)identifier
{
self = [super init];
if (self) {
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:[NSString stringWithFormat:@"%@",[self uuid]]];
configuration.HTTPMaximumConnectionsPerHost = 1;
operationSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration] delegate:self delegateQueue:nil];
_sessionDataTask = [operationSession dataTaskWithRequest:request];
}
return self;
}
I have a operation queue. And In each NSOperation
i have used session to downloading the content. I have ephemeralSessionConfiguration
and DefaultSessionConfiguration
. It is working fine for 200 0r 300 operations. But when the operation increase to 1000 to 1000+ it will give me time out, handshaking error. Please help me for best solution.