• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: URLSession on iOS 10
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URLSession on iOS 10


  • Subject: Re: URLSession on iOS 10
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 23 Nov 2016 11:43:55 -0800


On Nov 22, 2016, at 1:28 PM, Rick Mann <email@hidden> wrote:

FWIW, I'm also setting .httpShouldUsePipelining to true … I commented out all my adjustments and tried just the default URLSessionConfiguration, still the same behavior.

HTTP pipelining is problematic; it was badly designed. I wouldn’t recommend using it. (HTTP/2 does pipelining properly, but I’ve encountered problems using it with NSURLSession, at least in iOS 9.)

• Aside: I was getting the default URLSessionConfiguration and setting these properties. Should I be getting a copy of the default instead?

No need; that method returns a fresh instance every time.

• I'm also worried about the frequent "A server with the specified hostname could not be found" errors I get. Could that be the result of attempts at DNS resolution failing because of too many open files, and being changed into a not-found error? I also get "The Internet connection appears to be offline".

DNS resolution shouldn’t be affected by open sockets/files in your app, since it’s done in another process. These two errors sound like your device’s IP connection is being flaky.

• I don't understand why so many connections are opening, since I am currently limiting it to 4 tasks per session. It seems they're not closing after each use, but not getting re-used?

The sockets do get reused; they’re left open after a request completes, and can then be used to send another request. But the number of sockets per session should be no greater than the limit you specified. (You only open one NSURLSession, right?)


The code I work on uses NSURLSession very heavily, sending hundreds of parallel requests in a typical operation, and we haven’t seen problems on iOS 10. However, we don’t use download tasks, just data tasks.

—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

References: 
 >URLSession on iOS 10 (From: Rick Mann <email@hidden>)
 >Re: URLSession on iOS 10 (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: URLSession on iOS 10 (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: URLSession on iOS 10 (From: Rick Mann <email@hidden>)
 >Re: URLSession on iOS 10 (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: URLSession on iOS 10 (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: URLSession on iOS 10
  • Next by Date: Re: URLSession on iOS 10
  • Previous by thread: Re: URLSession on iOS 10
  • Next by thread: Re: URLSession on iOS 10
  • Index(es):
    • Date
    • Thread