SftpClient and Thread Safety
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
Hi,
I can't find any information on thread safety regarding ssh.net. I'm using SftpClient and sharing this accross multiple threads to download files, is this ok to do or should a client be created for each thread downloading a file?
It seems to work but on occasions the the downloads (3 of them) hang for around 5 minutes.

If pause the application I can see the following threads. I will do more investigation tomorrow, as I haven't ruled out the SFTP server either.
As a start if someone could answer if this is Thread safe and that downloading multiple files on different threads using a shared SftpClient is ok I would be appreciated.
Michael.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SftpClient and the reported concurrent downloads, then investigate whether shared use across threads is supported and whether the hangs are reproducible. The issue names no source files or tests; done means documenting the supported usage and any relevant concurrency limitations or guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100