> On Apr 10, 2015, at 4:13 PM, Jens Alfke <[email protected]> wrote:
> 
> 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.*

Or you would use CFReadStreamSetDispatchQueue/CFWriteStreamSetDispatchQueue.


> 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 
> <https://github.com/zwopple/PocketSocket/tree/master/PocketSocket>)
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/macnetworkprog/marc%40apple.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to