I have an Post Request, that needs to be submit using NSURLSession
. Due to some requirement, i have to set the timeout to 230 seconds. So the idea here is, the NSURLSession
should wait for 230 seconds until it declares the task as time out issue.
I have done some experiments as -
- I set some arbitrary 10 seconds to check timeout issue, work fine.
- I set 50 seconds as time out, works fine.
- I set 60 seconds (which is default timeout), it again works fine.
- I set 75 secods as time out, it also works fine.
- But, when i set 76 as time out, the request gets time out in 75 seconds
- I set 100 seconds as timeout, but again request gets timeout in 75 seconds.
- I set 200 seconds as timeout, again the request gets timeout in 75 seconds.
So is there some undocumented value like maximum timeout available is 75 seconds?
i am setting the timeout in 2 ways
- Using
timeoutInterval
property ofNSMutableURLRequest
- Using
defaultSessionConfiguration
properties,timeoutIntervalForRequest
andtimeoutIntervalForResource
I have used dataTaskWithRequest
to POST the service.
So the minimum value takes effect between all the three properties in determining the timeout. And if it is less than 75 seconds, it works fine. But if is greater than 75 seconds, it just ignores it.
Please let me know, what is issue? is 75 seconds is the highest time allocated for timeout or am i missing something here.
P.S. I am executing the task in the main thread and debugging in iOS 9.2. To make things clear, I am checking the timeout while server is not reachable