Re: Reuse and lifetime of NSURLSessions
Re: Reuse and lifetime of NSURLSessions
- Subject: Re: Reuse and lifetime of NSURLSessions
- From: Jens Alfke <email@hidden>
- Date: Tue, 27 Jan 2015 20:55:50 -0800
On Jan 27, 2015, at 5:50 PM, Greg Robbins < email@hidden> wrote:
1. Should there be one session per host, or one session for all of an app’s fetches, or should each session be used for some set of hosts?
Well, the old approach of using NSURLConnection is equivalent to having one global NSURLSession for all URL requests in your app. So at one extreme, you can use a single session.
I think it comes down to whether some of your requests need different parameters like delegates or caching or something like that. (Or different threading!) If they do, having a separate session is a convenient way to do that. Otherwise, I'd stick with one session for efficiency.
—Jens |
_______________________________________________
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