0
-(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.

PrafulD
  • 548
  • 5
  • 13

1 Answers1

0

In the same NSURLSessionConfiguration you can add/Increase timeout as :

 configuration.timeoutIntervalForRequest  = KTimeOutValue; //Your timeout value 
byJeevan
  • 3,728
  • 3
  • 37
  • 60