Skip to content

Commit

Permalink
fix: UnhandledException: System.ObjectDisposedException. (#1590)
Browse files Browse the repository at this point in the history
* fix: UnhandledException: System.ObjectDisposedException.
Error on thread pool

#1588

* tweak message

---------

Co-authored-by: Rob Hague <[email protected]>
  • Loading branch information
SoftStoneDevelop and Rob-Hague authored Feb 4, 2025
1 parent 3e2e260 commit 7a599e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Renci.SshNet/BaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,14 @@ private void SendKeepAliveMessage()
{
_ = session.TrySendMessage(new IgnoreMessage());
}
catch (ObjectDisposedException)
{
// ignore
}
catch (Exception ex)
{
_logger.LogError(ex, "Error sending keepalive message");
}
finally
{
Monitor.Exit(_keepAliveLock);
Expand Down

0 comments on commit 7a599e2

Please sign in to comment.