fix: direct server clients now have unique client IDs

Using the generated security token as an ID was presenting problems with duplicate connections using the same ID and trying to figure out where to send the messages. Now, the clients have a unique ID that's an increasing integer that restarts at 1 when the program restarts.
This commit is contained in:
Andrew Welker
2025-10-15 09:50:12 -05:00
parent 1197b15a33
commit 8525134ae7
10 changed files with 444 additions and 255 deletions

View File

@@ -0,0 +1,24 @@
using System;
namespace PepperDash.Essentials.WebSocketServer
{
/// <summary>
/// Event Args for <see cref="UiClient"/> ConnectionClosed event
/// </summary>
public class ConnectionClosedEventArgs : EventArgs
{
/// <summary>
/// Client ID that is being closed
/// </summary>
public string ClientId { get; private set; }
/// <summary>
/// Initalize an instance of the <see cref="ConnectionClosedEventArgs"/> class.
/// </summary>
/// <param name="clientId">client that's closing</param>
public ConnectionClosedEventArgs(string clientId)
{
ClientId = clientId;
}
}
}