On 26 Apr 2016, at 18:11, Sebastien Boisvert <[email protected]> 
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 protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to