Inter-Process Networking

Power Manager consists of a collection of processes. These processes include the Power Manager application, the Scheduler, and per-user assistants.

This section refers to versions of Power Manager between v5.0.0 – v5.10.2.

These processes need to find and talk to each other. This section discusses how this communication works.

On Start Up

The Scheduler is launched and kept running using a macOS launchd job stored in /Library/LaunchDaemons; list Power Manager’s launchd jobs with the command:

sudo launchctl list | grep uk\.co\.dssw\.powermanager

The Scheduler opens and listens on a TCP/IP socket. The socket’s port is assigned by macOS to avoid conflicting with other processes. Only connections originating on the same computer are accepted (local host only); list Power Manager’s TCP/IP sockets with the command:

sudo lsof -i | grep uk\.co

The Scheduler needs to let other processes know what port is being used. To do this, the Schedule registers a local only service using macOS’s dns-sd (Service Discovery); see Supporting Bonjour for the registered service details and to list Power Manager’s Service Discovery entries use the command:

dns-sd -B _pm._tcp.

Talking to the Scheduler

When the Power Manager application or another process needs to talk to the Scheduler, the following steps are performed.