• 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: NSURLSessionStreamTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLSessionStreamTask


  • Subject: Re: NSURLSessionStreamTask
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 16 Apr 2016 18:25:01 -0700


On Apr 16, 2016, at 3:29 PM, Daryle Walker <email@hidden> wrote:

The theoretical Gopher-aligned NSURLProtocol class should be able to allocate a NSURLSession object and make a NSURLSessionStreamTask from there.

Oh! I finally looked at the API more closely and saw that the factory method only takes a hostname and a port, not a URL as with the other task types. So this makes a lot more sense to me now. Sorry for being confused.

In that light, NSURLSessionStreamTask seems to be an equivalent of the existing +[NSStream getStreamsToHostWithName:…] API, that fits into the NSURLSession way of doing things. Two specific advantages over NSStream that I see at first glance are:
* It has async read and write methods that call completion blocks, which is a lot easier to use than the NSStream delegate API;
* It can be scheduled on an NSOperationQueue (NSStream only works with runloops.)
* Looks like enabling TLS is a lot simpler than with NSStream.

Plus the fact that you can easily choose to make a direct connection, or ‘tunnel’ the connection through HTTP as WebSockets does.

—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: 
 >NSURLSessionStreamTask (From: Daryle Walker <email@hidden>)
 >Re: NSURLSessionStreamTask (From: "Quinn \"The Eskimo!\"" <email@hidden>)
 >Re: NSURLSessionStreamTask (From: Daryle Walker <email@hidden>)
 >Re: NSURLSessionStreamTask (From: Jens Alfke <email@hidden>)
 >Re: NSURLSessionStreamTask (From: Daryle Walker <email@hidden>)

  • Prev by Date: Re: NSURLSessionStreamTask
  • Next by Date: Creating non-default vpn configurations for IPSEC/L2TP in osx
  • Previous by thread: Re: NSURLSessionStreamTask
  • Next by thread: Re: NSURLSessionStreamTask
  • Index(es):
    • Date
    • Thread