public void Dispose() { if (Interlocked.Increment(ref _disposeCount) != 1) { return; } _disposeToken?.Cancel(); _socketTask.SafeWait(TimeSpan.FromSeconds(30)); _socketTask.DisposeSafely(_log); _sslStream.DisposeSafely(_log); _netStream.DisposeSafely(_log); _client.DisposeSafely(_log); _disposeRegistration.DisposeSafely(_log); _disposeToken.DisposeSafely(_log); }
public void Dispose() { _cancellationTokenRegistration.DisposeSafely(_log); }