diff --git a/ApplicationWebSocket.cs b/ApplicationWebSocket.cs index 6da10a0..1ede16d 100644 --- a/ApplicationWebSocket.cs +++ b/ApplicationWebSocket.cs @@ -7,6 +7,7 @@ using ln.json; using ln.logging; using ln.types.rpc; using System.Linq; +using System.IO; namespace ln.application { public class ApplicationWebSocket : WebsocketResource @@ -48,6 +49,7 @@ namespace ln.application currentWebSockets.Add(webSocket); break; case WSREvent.CLOSE: + case WSREvent.ERROR: currentWebSockets.Remove(webSocket); break; } @@ -63,8 +65,13 @@ namespace ln.application { foreach (WebSocket webSocket in CurrentWebSockets) { - webSocket.Send(text); - } + try + { + webSocket.Send(text); + } + catch (IOException) + { } + } } public override void MessageReceived(WebSocketResourceRequestContext requestContext, string textMessage)