Hello,
I have the same problem. I'm using ssh.net 2014.4.6-beta2
I'm doing a reboot on a linux machine and disconnecting as fast as i can after that.
The sshclient hangs in the Disconnect method (_messageListenerCompleted.WaitOne()), se comment below.
I have the same problem. I'm using ssh.net 2014.4.6-beta2
I'm doing a reboot on a linux machine and disconnecting as fast as i can after that.
The sshclient hangs in the Disconnect method (_messageListenerCompleted.WaitOne()), se comment below.
private void Disconnect(DisconnectReason reason, string message)
{
_isDisconnecting = true;
// send disconnect message to the server if the connection is still open
// and the disconnect message has not yet been sent
//
// note that this should also cause the listener thread to be stopped as
// the server should respond by closing the socket
SendDisconnect(reason, message);
// disconnect socket, and dispose it
SocketDisconnectAndDispose();
if (_messageListenerCompleted != null)
{
// at this point, we are sure that the listener thread will stop
// as we've disconnected the socket
_messageListenerCompleted.WaitOne(); // <-- the code hangs here
_messageListenerCompleted.Dispose();
_messageListenerCompleted = null;
}
}