From 419cc2a0b0b8eedc0efd167bc07087b1f9c0aa5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Nag=C3=B3rski?= Date: Thu, 13 Apr 2023 13:42:05 +0200 Subject: [PATCH] ConnectionDisconnected --- src/Renci.SshNet.Tests/Common/AsyncSocketListener.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Renci.SshNet.Tests/Common/AsyncSocketListener.cs b/src/Renci.SshNet.Tests/Common/AsyncSocketListener.cs index 7900d26ba..5e9a38e36 100644 --- a/src/Renci.SshNet.Tests/Common/AsyncSocketListener.cs +++ b/src/Renci.SshNet.Tests/Common/AsyncSocketListener.cs @@ -323,13 +323,8 @@ void ConnectionDisconnected() } catch (ObjectDisposedException ex) { - //ConnectionDisconnected(); - if (!_started) - { - throw new Exception("BeginReceive throws ObjectDisposedException while stopping! " + _stackTrace, ex); - } - - throw new Exception("BeginReceive throws ObjectDisposedException while started! " + _stackTrace, ex); + // TODO On .NET 7, sometimes we get ObjectDisposedException when _started but only on appveyor, locally it works + ConnectionDisconnected(); } catch (SocketException ex) {