1234567891011121314151617 |
- using InABox.Client.WebSocket;
- namespace InABox.Clients
- {
- public static class SocketClientCache
- {
- private static Dictionary<string, WebSocketClient> Clients = new Dictionary<string, WebSocketClient>();
- public static void StartWebSocket(string url, int port, Guid session)
- {
- Uri uri = new Uri(url);
- var key = $"{uri.Host}${session}";
- if (!Clients.ContainsKey(key))
- Clients[key] = new WebSocketClient(uri.Host, port, session);
- }
- }
- }
|