I`m downloading files from external machine. Sometimes those files are downloaded ok, but sometimes exception occurs with message "An established connection was aborted by the software in your host machine".
I`m using Renci.SshNet.ScpClient and there is about 400 files to be retrieved. I can`t download whole directory at remote machine, because there is lot of other stuff too.
for (int file = 0; file < files; file++)
string fileToBeRetrieved = filenames[file];
string remoteFile = remotePath + "/" + fileToBeRetrieved;
string localFile = System.IO.Path.Combine(localPath, fileToBeRetrieved);
sshCp.Download(remoteFile, new FileInfo(localFile)); // sometimes CRASH
This might be problem with that device also, but if not should I used some connection/command timeout values or could there be a bug releated to this at SSH.NET?
I could load more than one file with SCP at once, but that`s not probably the solution for this.