예제 #1
0
        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);
        }
예제 #2
0
 public void Dispose()
 {
     _cancellationTokenRegistration.DisposeSafely(_log);
 }