We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb53850 commit 4435763Copy full SHA for 4435763
src/Renci.SshNet/BaseClient.cs
@@ -240,6 +240,11 @@ public void Connect()
240
var session = Session;
241
if (session is null || !session.IsConnected)
242
{
243
+ if (session is not null)
244
+ {
245
+ DisposeSession(session);
246
+ }
247
+
248
Session = CreateAndConnectSession();
249
}
250
@@ -304,6 +309,11 @@ public async Task ConnectAsync(CancellationToken cancellationToken)
304
309
305
310
306
311
312
313
314
315
316
307
317
Session = await CreateAndConnectSessionAsync(cancellationToken).ConfigureAwait(false);
308
318
319
0 commit comments