I want to download multiple files in parallel over SFTP, so if there is a large file that is started downloading first and a 2nd small download is started the 2nd download should not be held up by the 1st.
I can think of several ways to do this, but can't figure out which ones will work (or indeed if there is a better solution).
- One instance of Sftp and lots of calls to GetFileAsync
- One instance of Sftp and lots of Tasks (or threads) calling into it calling GetFile.
- Lots of Tasks all creating an instance of Sftp with a call to GetFile
Will any/all of these approaches work?
What is the recommended way of achieving what I want?
If you call sftp.Disconnect() does it abort all current transfers?