You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
/// Waits a specified time for a given <see cref="WaitHandle"/> to get signaled.
53
+
/// Waits a specified time for a given <see cref="WaitHandle"/> to be signaled.
53
54
/// </summary>
54
55
/// <param name="waitHandle">The handle to wait for.</param>
55
-
/// <param name="millisecondsTimeout">The number of milliseconds wait for <paramref name="waitHandle"/> to get signaled, or <c>-1</c> to wait indefinitely.</param>
56
+
/// <param name="millisecondsTimeout">The number of milliseconds to wait for <paramref name="waitHandle"/> to be signaled, or <c>-1</c> to wait indefinitely.</param>
56
57
/// <exception cref="SshException">The connection was closed by the server.</exception>
57
58
/// <exception cref="SshException">The channel was closed.</exception>
58
59
/// <exception cref="SshOperationTimeoutException">The handle did not get signaled within the specified timeout.</exception>
/// Asynchronously waits for a given <see cref="WaitHandle"/> to be signaled.
64
+
/// </summary>
65
+
/// <param name="waitHandle">The handle to wait for.</param>
66
+
/// <param name="millisecondsTimeout">The number of milliseconds to wait for <paramref name="waitHandle"/> to be signaled, or <c>-1</c> to wait indefinitely.</param>
67
+
/// <param name="cancellationToken">The cancellation token to observe.</param>
68
+
/// <exception cref="SshException">The connection was closed by the server.</exception>
69
+
/// <exception cref="SshException">The channel was closed.</exception>
70
+
/// <exception cref="SshOperationTimeoutException">The handle did not get signaled within the specified timeout.</exception>
71
+
/// <returns>A <see cref="Task"/> representing the wait.</returns>
/// Asynchronously waits for a given <see cref="TaskCompletionSource{T}"/> to complete.
76
+
/// </summary>
77
+
/// <typeparam name="T">The type of the result which is being awaited.</typeparam>
78
+
/// <param name="tcs">The handle to wait for.</param>
79
+
/// <param name="millisecondsTimeout">The number of milliseconds to wait for <paramref name="tcs"/> to complete, or <c>-1</c> to wait indefinitely.</param>
80
+
/// <param name="cancellationToken">The cancellation token to observe.</param>
81
+
/// <exception cref="SshException">The connection was closed by the server.</exception>
82
+
/// <exception cref="SshException">The channel was closed.</exception>
83
+
/// <exception cref="SshOperationTimeoutException">The handle did not get signaled within the specified timeout.</exception>
84
+
/// <returns>A <see cref="Task"/> representing the wait.</returns>
0 commit comments