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

Mitchell Laurren-Ring lists at rynosoft.com
Fri Mar 25 14:24:05 PDT 2016


I have a LaunchAgent that is configured via Sockets in the plist to listen on several IP+port number endpoints. I would like to make it possible to turn "off" some listening endpoints while the LaunchAgent is running.

Here’s a section of my plist:

	<key>Sockets</key>
	<dict>
		<key>RemoteSocket</key>
		<dict>
			<key>SockServiceName</key>
			<string>26666</string>
			<key>SockFamily</key>
			<string>IPv4</string>
			<key>Bonjour</key>
			<string>myService</string>
		</dict>

My process doesn’t have privileges so I can’t modify the plist. I could simply ignore connection attempts from my kevent code but, as you can see, I’m advertising my service via Bonjour.

What is the best practice for doing this? 



-Mitchell J Laurren-Ring

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/launchd-dev/attachments/20160325/0faf4c04/attachment.html>


More information about the launchd-dev mailing list