using System; using System.Collections.Concurrent; using System.Net.WebSockets; namespace Bts.DataStreamWebApp.Server { // public class WebSocketConnectionManager { // private readonly ConcurrentDictionary _sockets = new ConcurrentDictionary(); // public Guid AddSocket(WebSocket socket) { // var socketId = Guid.NewGuid(); // _sockets.TryAdd(socketId, socket); // return socketId; // } // public WebSocket? GetSocket(Guid socketId) { // _sockets.TryGetValue(socketId, out var socket); // return socket; // } // public ConcurrentDictionary.ValueCollection GetAllSockets() { // return _sockets.Values; // } // public Guid? GetSocketId(WebSocket socket) { // foreach (var (key, value) in _sockets) { // if (value == socket) { // return key; // } // } // return null; // } // public void RemoveSocket(Guid socketId) { // _sockets.TryRemove(socketId, out _); // } // } }