thanks reawakening the thread and for the updates.
i was testing the last commit to see if OperationTimeout works as i predicted.
i set: sftp.OperationTimeout = TimeSpan.FromSeconds(1);
and used asynchronous upload, usinf this code:
i was testing the last commit to see if OperationTimeout works as i predicted.
i set: sftp.OperationTimeout = TimeSpan.FromSeconds(1);
and used asynchronous upload, usinf this code:
sftp.ConnectionInfo.Timeout = TimeSpan.FromSeconds(1);
sftp.OperationTimeout = TimeSpan.FromSeconds(1);
sftp.Connect();
using (stream = new MemoryStream(byteArray))
{
IAsyncResult sftpASynch = sftp.BeginUploadFile(stream, fullPath, null, null);
if (!sftpASynch.AsyncWaitHandle.WaitOne(100))
{
sftp.EndUploadFile(sftpASynch);
Console.WriteLine("send file by sftp process was terminated after: " + sftpOperationTimeout + " seconds");
}
}
Console.WriteLine("Send by SFTP finished. Path:" + fullPath);
after some seconds (although OperationTimeout was set to 1 second) the file was uploaded to the server and was not terminated as supposed to.