• 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: Best practices for GCD-based socket I/O with SSL support?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practices for GCD-based socket I/O with SSL support?


  • Subject: Re: Best practices for GCD-based socket I/O with SSL support?
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Fri, 17 Apr 2015 09:51:29 +0100

On 13 Apr 2015, at 22:50, Jens Alfke <email@hidden> wrote:

> There’s probably an alternative way to run a listener/server socket, which could be scheduled on a dispatch queue, but I’m not too handy with BSD network APIs and I’ve never looked at dispatch_io. Anyone got any sample code or snippets?

There are two options here:

A. low-level -- Using BSD Sockets listen() and accept() with dispatch event sources to get the required async behaviour.

B. NSNetService -- On modern systems NSNetService can listen for incoming connections via the NSNetServiceListenForConnections flag.

Note that NSNetService does not currently support queue-based scheduling <rdar://problem/20584529>.  Despite that, I'd still go with option B.  Doing your own listening socket is not fun in the general case, and it's much easier to let the system take care of this for you.

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


References: 
 >Best practices for GCD-based socket I/O with SSL support? (From: Jens Alfke <email@hidden>)
 >Re: Best practices for GCD-based socket I/O with SSL support? (From: Marc Krochmal <email@hidden>)
 >Re: Best practices for GCD-based socket I/O with SSL support? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Does anyone know any Web and/or FTP sites with authentication?
  • Next by Date: Re: Does anyone know any Web and/or FTP sites with authentication?
  • Previous by thread: Re: Best practices for GCD-based socket I/O with SSL support?
  • Next by thread: Can't get remote host and port after CFStreamCreatePairWithSocketToNetService
  • Index(es):
    • Date
    • Thread