Reworked websocket communication to avoid high CPU usage by client application.

This commit is contained in:
Jakob Friedl
2025-11-02 09:57:53 +01:00
parent 8e16843aec
commit ec2388d993
2 changed files with 108 additions and 112 deletions

View File

@@ -44,10 +44,7 @@ proc websocketHandler(ws: WebSocket, event: WebSocketEvent, message: Message) {.
# Send the public key for the key exchange, all other information with be transmitted when the key exchange is completed
cq.client.sendPublicKey(cq.keyPair.publicKey)
of MessageEvent:
# Continuously send heartbeat messages
ws.sendHeartbeat()
of MessageEvent:
let event = message.recvEvent(cq.client.sessionKey)
case event.eventType: