public void Disconnect() { if (_client == null) { return; } _client.Disconnect(); }
public void Run(CancellationToken cancellationToken) { while (!cancellationToken.IsCancellationRequested) { if (LastPing < DateTimeOffset.Now - _client._configuration.Timeout) { _client.Disconnect(_client._configuration.ThrowsOnTimeout); return; } Thread.Sleep(5000); } }