feat: add DeleteAllUiClientsHandler and route for deleting all clients. Resolve issues with client closing websocket connection to DebugWebsocketSink

This commit is contained in:
Neil Dorin 2026-04-14 22:12:39 -06:00
parent a610e127de
commit 6e9480f503
3 changed files with 255 additions and 108 deletions

View file

@ -238,11 +238,17 @@ namespace PepperDash.Essentials.WebSocketServer
var routes = new List<HttpCwsRoute>
{
new HttpCwsRoute($"devices/{Key}/client")
new HttpCwsRoute($"device/{Key}/client")
{
Name = "ClientHandler",
RouteHandler = new UiClientHandler(this)
},
new HttpCwsRoute($"device/{Key}/deleteAllUiClients")
{
Name = "DeleteAllClientsHandler",
RouteHandler = new DeleteAllUiClientsHandler(this)
},
};
apiServer.AddRoute(routes);
@ -908,7 +914,7 @@ namespace PepperDash.Essentials.WebSocketServer
/// <summary>
/// Removes all clients from the server
/// </summary>
private void RemoveAllTokens(string s)
public void RemoveAllTokens(string s)
{
if (s == "?" || string.IsNullOrEmpty(s))
{