Skip to content

Commit e74a3bd

Browse files
fix: UnhandledException: System.ObjectDisposedException.
Error on thread pool #1588
1 parent 3e2e260 commit e74a3bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Renci.SshNet/BaseClient.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,14 @@ private void SendKeepAliveMessage()
502502
{
503503
_ = session.TrySendMessage(new IgnoreMessage());
504504
}
505+
catch (ObjectDisposedException)
506+
{
507+
// ignore
508+
}
509+
catch (Exception ex)
510+
{
511+
_logger.LogError(ex, "Error in TrySendMessage");
512+
}
505513
finally
506514
{
507515
Monitor.Exit(_keepAliveLock);

0 commit comments

Comments
 (0)