diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2025-05-09 22:34:25 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2025-05-09 23:12:41 +0200 |
commit | d647405a20932a2ee131b4287c8b99de38b95a8d (patch) | |
tree | 88f2753edf05c37405f54201f51c30b10a78b669 /xM/main.swift | |
parent | d572cfeb40b996a898f6d67d273fac2fab37c86e (diff) | |
download | xK-d647405a20932a2ee131b4287c8b99de38b95a8d.tar.gz xK-d647405a20932a2ee131b4287c8b99de38b95a8d.tar.xz xK-d647405a20932a2ee131b4287c8b99de38b95a8d.zip |
WIP: Make the relay acknowledge received commands
xP now slightly throttles activity notifications,
and indicates when there are unacknowledged commands.
Relay events have been reordered to improve forward compatibility.
As can be observed, even the smallest protocol change has
great consequences.
WIP:
- xC: fix connection killing
Diffstat (limited to 'xM/main.swift')
-rw-r--r-- | xM/main.swift | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xM/main.swift b/xM/main.swift index 48f26c4..39b66c5 100644 --- a/xM/main.swift +++ b/xM/main.swift @@ -173,8 +173,11 @@ class RelayRPC { func send(data: RelayCommandData, callback: Callback? = nil) { self.commandSeq += 1 let m = RelayCommandMessage(commandSeq: self.commandSeq, data: data) - if let callback = callback { - self.commandCallbacks[m.commandSeq] = callback + self.commandCallbacks[m.commandSeq] = callback ?? { error, data in + if data == nil { + NSSound.beep() + Logger().warning("\(error)") + } } var w = RelayWriter() |