mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-10-18 14:36:11 +08:00
b7c5f1a87d
The recently added UploadFileAsync effectively calls stream.CopyToAsync(SftpFileStream). This is slower than the sync UploadFile (by about 4x in a local test) because the sync version sends multiple write requests concurrently, without waiting for each response in turn like the stream-based version does. This change adapts the sync code for async and uses it to bring the performance of UploadFileAsync in line with that of UploadFile.