SftpClient is not returning from the Dispose method. This issue is happening when the StfpClient has tried to connect and a SshOperationTimeoutException has occurred. The dispose is hanging when it calls Session.Dispose, code snippet:
if (this._messageListenerCompleted != null)
{
// Wait for socket to be closed and for task to complete before disposing a task
this._messageListenerCompleted.WaitOne();
this._messageListenerCompleted.Dispose();
this._messageListenerCompleted = null;
}
The program is stuck on line: this._messageListenerCompleted.WaitOne();
Any fixes or workarounds for this?