Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmds committed Dec 11, 2024
1 parent d4ab315 commit 0103030
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/Tmds.Ssh/SshSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SshConnection> EstablishConnectionAsync(CancellationToken ct)
{
Debug.Assert(_settings is not null);
Expand Down

0 comments on commit 0103030

Please sign in to comment.