Well, I've tried to do this, and I can't confirm that these callbacks are called.
My setup is:
macOS Big Sur 11.6.2, mac mini, I've set the Turn display off after 1 minute of inactivity, removed the check to prevent it from sleep in that case.
system network extension with Packet Tunnel Provider inside, based on wireguard opensource project
I've added just such lines:
override func sleep(completionHandler: @escaping () -> Void) {
wg_log(.info, message: "Got sleep from provider")
completionHandler()
}
override func wake() {
wg_log(.info, message: "Got wake from provider")
}
And I've never seen such logs after several sleep-wake retries. All other logs from this class are ok, I can see them.
Should I do anything else, except adding these lines to the class to subscribe the sleep/wake notifications?
I've recorded the Console logs, but there are a lot, and nothing I can see related to my issue. Could you please point, what am I looking for?
Topic:
App & System Services
SubTopic:
Networking
Tags: