Fix ApplicationWebSocket behaviour on IOException

This commit is contained in:
Harald Wolff 2019-09-02 12:17:50 +02:00
parent 99cb425199
commit eeed531377

View file

@ -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)