Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSURLSession sharedSession default timeout

Would anyone know what are the timeouts configuration for [NSURLSession sharedSession]?

I am doing some debugging and this information would be very helpful.

Edit

Apparently my question is not clear (!). I am not asking how to change the timeout. I am asking what the default is. So this is not a duplicate.

like image 645
vib Avatar asked Sep 06 '17 21:09

vib


People also ask

What is timeout interval?

The request timeout interval controls how long (in seconds) a task should wait for additional data to arrive before giving up. The timer associated with this value is reset whenever new data arrives.

What is Nsurlsession?

URLSession is the key object responsible for sending and receiving requests. You create it via URLSessionConfiguration , which comes in three flavors: default: Creates a default configuration object that uses the disk-persisted global cache, credential and cookie storage objects.


1 Answers

There are two timeouts for URL sessions. The first is the maximum time allowed between receiving new data. This is called the timeoutIntervalForRequest. The second is the maximum time the entire request is allowed to take (assuming it's regularly receiving new data). This is called the timeoutIntervalForResource.

Both of these timeouts are configured by default using NSURLSessionConfiguration, and can be overridden on the NSURLRequest.

The default timeoutIntervalForRequest is 60 seconds.

The default timeoutIntervalForResource is 7 days.

like image 153
Lily Ballard Avatar answered Sep 18 '22 17:09

Lily Ballard