Re: Mach Bootstrap_create_server, "server_command" parameter
Re: Mach Bootstrap_create_server, "server_command" parameter
- Subject: Re: Mach Bootstrap_create_server, "server_command" parameter
- From: Quinn <email@hidden>
- Date: Wed, 18 Feb 2009 09:43:03 +0000
At 16:59 -0500 17/2/09, Michael Prenez-Isbell wrote:
Can NSMachPort be used for IPC? I don't see a way to make an NSMachPort
local or remote. It seems as if you already have to have a mach port to use
it.
If this is possible, is there a coding example?
Or is CFMessagePort a better way to go?
NSMachPort is part of the Distributed Objects suite of APIs, and
isn't really designed for generic IPC.
CFMachPort /is/, however, it's pretty low level so you tend to run
into the same sorts of issues as you would with raw Mach ports.
CFMessagePort is a pretty reasonable, albeit very simplistic,
high-level abstraction for Mach IPC.
However, I really think you're better off using UNIX domain sockets.
Regardless of how you use it, Mach IPC is tricky because:
o service discovery inevitably drags you into the whole Mach
bootstrap namespaces issue; see TN2083 for details
o Mach ports are connectionless, which means you have to just through
hoops to determine when clients come and go
Sockets provides an (IMO) easier and (certainly) better understood
model of IPC.
S+E
--
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.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden