Initial commit.

This commit is contained in:
2026-03-13 10:23:47 +01:00
parent fd81c63020
commit 39c8b861c0
44 changed files with 1144 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
using System.Collections.Concurrent;
namespace ClientApiPoC.Shared.SignalR {
public class ClientTracker {
private ConcurrentDictionary<string, string> _knownClientIds = new();
public ICollection<string> CurrentClientIds => _knownClientIds.Values;
public bool TryAddClientId(string clientId) {
if (string.IsNullOrWhiteSpace(clientId)) throw new ArgumentNullException(nameof(clientId));
return _knownClientIds.TryAdd(clientId, clientId);
}
public bool TryRemoveClientId(string clientId) {
return _knownClientIds.TryRemove(clientId, out _);
}
}
}