Ken, i have an agent and a corresponding per-agent process (this per-agent process, apart from doing its main job and displaying gui when its clicked, displays an icon in dock which can change colors). Of course, the agent is spawned for every logged in user. I found parent-child connected (socketpair) sockets/pipes to be the easiest way to set up a conversation between an agent and that peruser application in Dock. And in Snow Leopard it works.
This "per user" idea does not let me use any advertisement-based IPCs (like user domain sockets or bonjour). I need some "per user only" IPC - so other user's instance of the process does not interfere with the current user's one. I've heard that Mach Ports can be set to be seen only in the current login session (i.e., by current user's apps), but search led me to conclusion this is rather a messy/few documented (for usermode applications) topic and it behaves differently for Leopard and Snow Leopard due to some changes in "bootstrap context" 2011/6/11 Ken Thomases <[email protected]> > On Jun 11, 2011, at 10:32 AM, Nick wrote: > > Why do you care if it's the parent? What feature(s) of the parent-child > relationship is (are) important? Maybe what you're trying to achieve can be > accomplished in some other manner while still using NSWorkspace or Launch > Services to launch the application (which is the right way). > > If it's just inter-process communication, there are other options. For > example, use Bonjour for the parent to advertise its service and for the > child to find and connect to it. Or use Unix domain sockets with a path > that is known to both. Using Launch Services, you can pass an Apple Event > descriptor with additional parameter information, which the child can > retrieve. (The methods of NSWorkspace claim to support this, but I've found > them to be buggy in this regard.) Etc. > > Regards, > Ken > > _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
