diff --git a/DysonNetwork.Pusher/Connection/WebSocketController.cs b/DysonNetwork.Pusher/Connection/WebSocketController.cs index dd6992a..6d0245a 100644 --- a/DysonNetwork.Pusher/Connection/WebSocketController.cs +++ b/DysonNetwork.Pusher/Connection/WebSocketController.cs @@ -39,6 +39,16 @@ public class WebSocketController(WebSocketService ws, ILogger if (!ws.TryAdd(connectionKey, webSocket, cts)) { + await webSocket.SendAsync( + new ArraySegment(new WebSocketPacket + { + Type = "error.dupe", + ErrorMessage = "Too many connections from the same device and account." + }.ToBytes()), + WebSocketMessageType.Close, + true, + CancellationToken.None + ); await webSocket.CloseAsync( WebSocketCloseStatus.PolicyViolation, "Too many connections from the same device and account.",