public virtual void StopListenTickerStream(Ticker ticker) { SubscribedTickers.Remove(ticker); SocketConnectionInfo info = GetConnectionInfo(ticker, OrderBookSockets); if (info != null) { info.Socket.Error -= OnOrderBookSocketError; info.Socket.Opened -= OnOrderBookSocketOpened; info.Socket.Closed -= OnOrderBookSocketClosed; info.Socket.MessageReceived -= OnOrderBookSocketMessageReceived; info.Close(); info.Dispose(); OrderBookSockets.Remove(info.Socket); } info = GetConnectionInfo(ticker, TradeHistorySockets); if (info != null) { info.Socket.Error -= OnTradeHistorySocketError; info.Socket.Opened -= OnTradeHistorySocketOpened; info.Socket.Closed -= OnTradeHistorySocketClosed; info.Socket.MessageReceived -= OnTradeHistorySocketMessageReceived; info.Close(); info.Dispose(); TradeHistorySockets.Remove(info.Socket); } }
public override void StopListenKlineStream(Ticker ticker, CandleStickIntervalInfo klineInfo) { SocketConnectionInfo info = GetConnectionInfo(ticker, klineInfo, KlineSockets); if (info == null) { return; } info.Socket.Error -= OnKlineSocketError; info.Socket.Opened -= OnKlineSocketOpened; info.Socket.Closed -= OnKlineSocketClosed; info.Socket.MessageReceived -= OnKlineSocketMessageReceived; info.Close(); info.Dispose(); KlineSockets.Remove(info.Socket); }