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?
Iain, 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. -- Damien Sorresso BSD Engineering Apple Inc.