Re: Multiple NSURLSession (same identifier) - one invalidated, one not
Re: Multiple NSURLSession (same identifier) - one invalidated, one not
- Subject: Re: Multiple NSURLSession (same identifier) - one invalidated, one not
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Wed, 27 Apr 2016 08:52:36 +0100
On 26 Apr 2016, at 18:11, Sebastien Boisvert <email@hidden> wrote:
> Specifically, I'm wondering if I invalidate an existing session (using something like -finishTasksAndInvalidate), then bring up a new one with the same identifier/configuration (while the first might still have its tasks going), if this is safe to do so.
That depends on /when/ you bring up the new session. The sequence create-gen-1 > invalidate > create-gen-2 is fine as long as you do the create-gen-2 after -URLSession:didBecomeInvalidWithError: has been called. The problem you’re going to have here is that, if there are tasks running, -finishTasksAndInvalidate won’t trigger the actual invalidate until all the tasks are done.
Look at this from the perspective of `nsurlsessiond`. It uses the session identifier to track the session internally. Thus, it makes sense that you can’t create “foo” gen-2 while tasks are running in “foo” gen-1.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden