private void Unsubscribe(ExileTradeWebSocket webSocket) { webSocket.OnNewIdRecievedEvent -= OnNewIdRecievedEvent; webSocket.OnLogMessageEvent -= OnLogMessageEvent; webSocket.OnConnectedEvent -= OnWebSocketConnected; webSocket.OnDisconnectedEvent -= OnWebSocketDisconnected; }
public bool Add(ExileTradeWebSocketSetting setting) { if (WebSockets.Count >= _limit) { Log($"WebSockets limit reached [{WebSockets.Count}/{_limit}]"); return(false); } var ws = new ExileTradeWebSocket(setting.Query, setting.League, _wsFactory); Subscribe(ws); return(WebSockets.TryAdd(setting.Name, ws)); }