Timeouts in NSURLSession
Timeouts in NSURLSession
- Subject: Timeouts in NSURLSession
- From: Rick Mann <email@hidden>
- Date: Wed, 29 Jul 2015 17:55:25 -0700
I'm starting hundreds of download tasks on a single NSURLSession. The session nicely limits the number of concurrent downloads, and everything seems to behave, until I some time has elapsed equal to the default value of timeoutIntervalForRequest, 60 seconds (I don't currently adjust this).
Others have experienced this, as evidenced by this post (http://stackoverflow.com/questions/20888841/set-number-of-concurrent-downloads-with-nsurlsessiondownloadtask). The problem is that the timer for the request is started when the task is resumed, and not when its request is actually first issued. This means that if you have more tasks than the HTTPMaximumConnectionsPerHost, and those tasks take longer than timeoutIntervalForRequest, the next task will time out, even though it hasn't yet begun.
I think this is a bug, and I'm filing it as such, but I wanted to get other opinions. It seems the only workaround is to make the timeoutIntervalForRequest very long, too, which is gross, as a single request may legitimately time out in a short amount of time, but the large set of tasks could take much longer to run through.
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden