fix ws issue

This commit is contained in:
zznty
2023-03-26 13:21:46 +07:00
parent a73610c83b
commit ed61b0b348
3 changed files with 3 additions and 7 deletions

View File

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

View File

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

View File

@@ -2,5 +2,5 @@
<PluginManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>Torch Remote</Name>
<Guid>284017F3-9682-4841-A544-EB04DB8CB9BA</Guid>
<Version>v1.0.8</Version>
<Version>v1.0.9</Version>
</PluginManifest>