[launchd-dev] Diagnosing launchd daemon failure to launch
dsorresso at apple.com
Thu Nov 6 13:36:55 PST 2008
On Nov 6, 2008, at 12:17 PM, Iain Delaney wrote:
> Hi Damien,
> Thanks for the feedback. I've looked at the SampleD code and plist,
> but there's something I don't understand. I based my domain sockets
> code on the code in the CFLocalServer sample program, and that code
> uses a string constant for the socket path, shared between the
> client and server. What is the purpose of putting the path in the
> daemon plist? If I put the path in the plist, and the server gets it
> from launchd, how does the client get to the socket?
This is all illustrated in SampleD. Your daemon obtains a file
descriptor directly from launchd. This is so launchd can launch your
daemon on-demand when there are data on the socket.
You can create a CFSocketRef with that descriptor using
CFSocketCreateWithNative() if you wish.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2474 bytes
Desc: not available
More information about the launchd-dev