Skip to content

Commit 7a599e2

Browse files
fix: UnhandledException: System.ObjectDisposedException. (#1590)
* fix: UnhandledException: System.ObjectDisposedException. Error on thread pool #1588 * tweak message --------- Co-authored-by: Rob Hague <[email protected]>
1 parent 3e2e260 commit 7a599e2

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 sending keepalive message");
512+
}
505513
finally
506514
{
507515
Monitor.Exit(_keepAliveLock);

0 commit comments

Comments
 (0)