This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SftpExtensions | |
{ | |
/// <remarks> | |
/// unfortunately the ssh library doesn't expose a modern async api | |
/// that supports cancellation via CancellationToken | |
/// so we have to wrap the APM pattern with a TaskCompletionSource | |
/// </remarks> | |
public static Task UploadFileAsync(this SftpClient sftpClient, Stream input, string path, bool canOverride, Action<ulong> uploadCallback = null, CancellationToken cancellationToken = default(CancellationToken)) | |
{ | |
var tcs = new TaskCompletionSource<SftpUploadAsyncResult>(); |