Websocket handler

This commit is contained in:
2025-07-18 16:12:34 +08:00
parent 086a12f971
commit 57f85ec341
12 changed files with 276 additions and 15 deletions

View File

@@ -40,8 +40,8 @@ public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext>
if (!ws.TryAdd(connectionKey, webSocket, cts))
{
await webSocket.CloseAsync(
WebSocketCloseStatus.InternalServerError,
"Failed to establish connection.",
WebSocketCloseStatus.PolicyViolation,
"Too many connections from the same device and account.",
CancellationToken.None
);
return;