I'm using a MachService (LaunchDaemon). startAndBlock will run this forever, but I'd like to quit the process if there are no active connections for a while (say 30 sec). I'm thinking that using start and my own run loop would be the best solution here.
However, there is no way to tell how many active, valid connections there are because it's all handled internally. The only place I can see is listening for .connectionInvalid in setErrorHandler, but that is not enough to determine that the server should quit. How should this use case be implemented?