コード例 #1
0
 private void Unsubscribe(ExileTradeWebSocket webSocket)
 {
     webSocket.OnNewIdRecievedEvent -= OnNewIdRecievedEvent;
     webSocket.OnLogMessageEvent    -= OnLogMessageEvent;
     webSocket.OnConnectedEvent     -= OnWebSocketConnected;
     webSocket.OnDisconnectedEvent  -= OnWebSocketDisconnected;
 }
コード例 #2
0
        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));
        }