Пример #1
0
        public void Disconnect()
        {
            _cancellationTokenSource.Cancel();
            _requestsQueue = new ConcurrentQueue <string>();

            _sendTask?.Wait();
            _listenerTask?.Wait();
            _requestHandlerTask?.Wait();
            OnRouterConnectionStateChanged?.Invoke(this, new EventArgs <bool>(false));
        }
Пример #2
0
 public void Disconnect()
 {
     _cancellationTokenSource?.Cancel();
     _tcpClient?.Close();
     OnRouterConnectionStateChanged?.Invoke(this, new EventArgs <bool>(false));
 }