fix: daemon port conflict handling, multi-port TUI connect

- start-daemon: handle ADDRESS-IN-USE-ERROR by trying ports 9105-9115
  instead of crashing. Logs which port is used.
- Add *daemon-port* defvar to track actual listening port
- main: wrap start-daemon in handler-case so the daemon doesn't
  crash if all ports are in use
- connect-daemon (TUI): try ports 9105-9115 with 2s timeout each
  instead of retrying the same port 3 times
- Add debug messages for connection success and disconnection timestamp
This commit is contained in:
2026-05-15 10:56:09 -04:00
parent 5924994202
commit d14ff3a316
3 changed files with 42 additions and 30 deletions

View File

@@ -367,7 +367,10 @@ Boot sequence:
(when (fboundp 'events-start-heartbeat)
(events-start-heartbeat))
(start-daemon)
(handler-case (start-daemon)
(error (c)
(log-message "DAEMON: Failed to start — ~a" c)
(format *error-output* "~&DAEMON: Failed to start — ~a~%" c)))
#+sbcl
(sb-sys:enable-interrupt sb-unix:sigint