Re: Daemon Communication
Re: Daemon Communication
- Subject: Re: Daemon Communication
- From: Jens Alfke <email@hidden>
- Date: Thu, 24 Jun 2010 08:23:45 -0700
On Jun 24, 2010, at 5:37 AM, Paolo Ambrosio wrote:
> I am in the process of starting the development of a daemon that
> should interact with local CLI and GUI clients
Are you sure you really need a daemon and not an agent? Daemons are harder to write since they don’t run as a “real” user or within a regular login session. Moreover, if you run a daemon as root, you have to be very careful about security.
> "Apple
> recommends that you use UNIX domain sockets for client/daemon
> communication". Does Spotlight use this method?
A lot of Apple stuff uses Mach messages, with MIG as the RPC mechanism. I think this is not recommended for 3rd party developers because there isn’t good documentation for it (for some reason Apple has never released real docs for Mach-level stuff, so you often have to dig up old NeXT docs or even stuff from the CMU Mach project.)
> i read that Carbon and Cocoa are not
> available for use in daemon code, and it makes sense. Does it mean
> that I won't be able to vend an object using Distributed Objects
> (without an agent wrapping Cocoa messages to the Unix Socket)?
“Cocoa” is a marketing term, not a real framework :) Or rather, it’s used as an aggregate term for Foundation + AppKit.
AppKit definitely shouldn’t be used in a daemon or agent. Foundation is safe for agents, and I would guess that subsets of Foundation are safe for daemons — the core Obj-C stuff should be OK, but I have no idea what things like NSUserDefaults will do if they’re not running as a regular GUI account with a Library/ subdirectory.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden