I keep getting hit over the head that I should stop using Mach ports for IPC switch to XPC. Until now, I've resisted because of the radical differences between the two communication models AND that I am still supporting OS X 10.6 (which has no XPC).
Well, OS X 10.6 is now on the chopping block so I started looking into XPC and immediately got stuck.
How can a process create advertise a named XPC service that other processes can connect to?
Right now, my application spawns multiple helper processes. Each helper process establishes itself as a service (with a uniquely named Mach service) that other processes then connect to. Some of those processes connect to control/direct a helper process; others simply connect to monitor and report on its progress. And just to complicate things, some of those helper processes are running in the user's bootstrap as a regular user process, while others are launched by a priviledged helper and run as root.
I can't figure out how to do this using XPC. launchd doesn't appear to support this kind of model and I can't find any function that will create a named XPC connection that other processes can use to connect with it. I initially thought that you would register a name and then bind an XPC connection to it, but I can't find any such facility.
So now I'm asking, is this even possible?