diff --git a/TorchRemote.Plugin/Modules/ChatModule.cs b/TorchRemote.Plugin/Modules/ChatModule.cs index 8ff9b54..ed34d90 100644 --- a/TorchRemote.Plugin/Modules/ChatModule.cs +++ b/TorchRemote.Plugin/Modules/ChatModule.cs @@ -17,9 +17,7 @@ public class ChatModule : WebSocketModule return; var buffer = JsonSerializer.SerializeToUtf8Bytes(response, Statics.SerializerOptions); - await Task.WhenAll(ActiveContexts - .Where(b => b.WebSocket.State is WebSocketState.Open) - .Select(context => context.WebSocket.SendAsync(buffer, true))); + await BroadcastAsync(buffer); } protected override async Task OnMessageReceivedAsync(IWebSocketContext context, byte[] buffer, IWebSocketReceiveResult result) diff --git a/TorchRemote.Plugin/Modules/LogsModule.cs b/TorchRemote.Plugin/Modules/LogsModule.cs index de30a76..93cf7b5 100644 --- a/TorchRemote.Plugin/Modules/LogsModule.cs +++ b/TorchRemote.Plugin/Modules/LogsModule.cs @@ -29,9 +29,7 @@ public class LogsModule : WebSocketModule var response = new LogLineResponse(time, (LogLineLevel)level.Ordinal, logger, message); var buffer = JsonSerializer.SerializeToUtf8Bytes(response, Statics.SerializerOptions); - await Task.WhenAll(ActiveContexts - .Where(b => b.WebSocket.State is WebSocketState.Open) - .Select(context => context.WebSocket.SendAsync(buffer, true))); + await BroadcastAsync(buffer); } private void ConfigureLogging() diff --git a/TorchRemote.Plugin/manifest.xml b/TorchRemote.Plugin/manifest.xml index bd87216..5c645b6 100644 --- a/TorchRemote.Plugin/manifest.xml +++ b/TorchRemote.Plugin/manifest.xml @@ -2,5 +2,5 @@ Torch Remote 284017F3-9682-4841-A544-EB04DB8CB9BA - v1.0.8 + v1.0.9 \ No newline at end of file