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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With