mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-05-08 07:08:05 +03:00
LSUIElement processes are prime App Nap candidates when idle, and once App-Napped macOS throttles user-space timers. The ping_pong keepalive loop in src/connect.rs uses tokio sleeps with a 2 s ping cycle; if those sleeps slip past the peer's 1 s grace the peer's watchdog tears down the DTLS connection and the daemon reconnects from a fresh ephemeral port on the next event — the "silence-then-new-source-port" pattern visible in the peer's logs after long idle. Setting NSAppSleepDisabled keeps the timers running on schedule across long idle windows. No code-side changes; the key is honored by macOS for the lifetime of the process. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>