Re: Managing Multiple Connections
Re: Managing Multiple Connections
- Subject: Re: Managing Multiple Connections
- From: James Matthews <email@hidden>
- Date: Wed, 21 May 2003 12:45:26 -0400
At 9:03 AM -0700 5/21/03, Becky Willrich wrote:
The usual way to arrange for cross-thread communication in this
model is to build a custom run loop source (see CFRunLoop.h; this
isn't as hard as it sounds) and install it on the run loop as well.
When you want to communicate something to the connection thread, you
signal the custom run loop source; that will cause its signal
callback to be called on the connection thread.
Would another approach be to create a pair of anonymous UNIX domain
sockets with socketpair(), and call CFStreamCreatePairWithSocket() to
hook them up to CFReadStream and CFWriteStream objects? That would
save the trouble of building a custom run loop source -- are there
reasons why the custom source would be preferred?
Thanks,
--
Jim Matthews
Fetch Softworks
http://fetchsoftworks.com
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.