コード例 #1
0
 public void Disconnect()
 {
     if (_client == null)
     {
         return;
     }
     _client.Disconnect();
 }
コード例 #2
0
        public void Run(CancellationToken cancellationToken)
        {
            while (!cancellationToken.IsCancellationRequested)
            {
                if (LastPing < DateTimeOffset.Now - _client._configuration.Timeout)
                {
                    _client.Disconnect(_client._configuration.ThrowsOnTimeout);
                    return;
                }

                Thread.Sleep(5000);
            }
        }