[launchd-dev] LaunchAgent best practice for turning "off" sockets

Quinn "The Eskimo!" eskimo1 at apple.com
Thu Mar 31 00:36:33 PDT 2016


On 30 Mar 2016, at 22:26, Mitchell Laurren-Ring <lists at rynosoft.com> wrote:

> How about ignoring the socket when I’m adding my sockets to the kevent queue?

That'll certainly work.  The potential gotcha is that a pending connection to this socket is considered 'demand' by launchd, and thus will keep your daemon running.  You might be better off accepting, and then immediately closing, these connections.  Under normal circumstances that's not a great option, but if you control the client you can code it to handle that pattern.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware




More information about the launchd-dev mailing list