protected override void OnDisconnecting()
{
base.OnDisconnecting();
// disconnect, dispose and dereference the SFTP session since we create a new SFTP session
// on each connect
var sftpSession = _sftpSession;
if (sftpSession != null)
{
_sftpSession = null;
sftpSession.Dispose();
}
}