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

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


  • Subject: Best practices for GCD-based socket I/O with SSL support?
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 10 Apr 2015 16:13:50 -0700

Are there any frameworks or sample code that illustrate best practices for doing TCP socket I/O using GCD (dispatch queues and/or NSOperationQueues?)

The conundrum seems to be that:
* dispatch_io looks like a great lightweight mechanism for doing I/O on dispatch queues.
But since it operates on raw file descriptors it doesn’t support SSL.
And implementing SSL support using SecureTransport is messy.
* CFStream on the other hand has transparent support for SSL.
But it’s an old API that uses runloops to schedule callbacks.
So you have to use a workaround like creating a background thread with a runloop,
and making the callbacks trampoline to your dispatch queue.*

Thus far I’ve been using GCDAsyncSocket, but it’s a huge and impenetrable piece of code and I’d like to ditch it for something smaller and more manageable. I’d love to use dispatch_io, but SSL is an absolute necessity for me, and remembering my last experience working with SecureTransport, I’m not eager to do it again.

—Jens

* PocketSocket is a good example of this approach (https://github.com/zwopple/PocketSocket/tree/master/PocketSocket)
 _______________________________________________
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

  • Follow-Ups:
    • Re: Best practices for GCD-based socket I/O with SSL support?
      • From: Marc Krochmal <email@hidden>
  • Prev by Date: Re: Using NSProgress with NSURLSessionDownloadTask
  • Next by Date: Re: Best practices for GCD-based socket I/O with SSL support?
  • Previous by thread: Re: Using NSProgress with NSURLSessionDownloadTask
  • Next by thread: Re: Best practices for GCD-based socket I/O with SSL support?
  • Index(es):
    • Date
    • Thread