From 0103030a8eab3924c68f5426d228659d6039060a Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Wed, 11 Dec 2024 08:15:40 +0100 Subject: [PATCH] Cleanup. --- src/Tmds.Ssh/SshSession.cs | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/Tmds.Ssh/SshSession.cs b/src/Tmds.Ssh/SshSession.cs index 5d35fff..4be2c63 100644 --- a/src/Tmds.Ssh/SshSession.cs +++ b/src/Tmds.Ssh/SshSession.cs @@ -98,33 +98,6 @@ public async Task ConnectAsync(TimeSpan connectTimeout, CancellationToken ct = d await task; } - public async Task DisconnectedAsync(CancellationToken cancellationToken) - { - Task? runningConnectionTask = null; - lock (_gate) - { - // Throw if a user has Disposed before calling this method. - ThrowIfDisposed(); - - runningConnectionTask = _runningConnectionTask; - } - - if (runningConnectionTask is null) - { - Debug.Assert(false); // this method shouldn't ever get called if we never connected. - ThrowNeverConnected(); - } - await runningConnectionTask.WaitAsync(cancellationToken); - - // Don't throw if the connection was closed due to an explicit close by the user. - if (_abortReason == DisposedException) - { - return; - } - - ThrowNewConnectionClosedException(); - } - private async Task EstablishConnectionAsync(CancellationToken ct) { Debug.Assert(_settings is not null);