-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable list directory async for net framework #1206
Enable list directory async for net framework #1206
Conversation
src/Renci.SshNet/SftpClient.cs
Outdated
asyncResult.Update(offset); | ||
uploadCallback?.Invoke(offset); | ||
}); | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo formatting changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/Renci.SshNet/SftpClient.cs
Outdated
@@ -2148,18 +2144,18 @@ public IAsyncResult BeginSynchronizeDirectories(string sourcePath, string destin | |||
var asyncResult = new SftpSynchronizeDirectoriesAsyncResult(asyncCallback, state); | |||
|
|||
ThreadAbstraction.ExecuteThread(() => | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indent block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/Renci.SshNet/SftpClient.cs
Outdated
@@ -2445,20 +2441,20 @@ private void InternalUploadFile(Stream input, string path, Flags flags, SftpUplo | |||
var writtenBytes = offset + (ulong) bytesRead; | |||
|
|||
_sftpSession.RequestWrite(handle, offset, buffer, offset: 0, bytesRead, wait: null, s => | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indent block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -13,6 +13,10 @@ | |||
<PackageReference Include="SshNet.Security.Cryptography" Version="[1.3.0]" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it conditional so that it only applies to TFMs that do not support IAsyncEnumerable<T> out-of-the-box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment, good idea! Done.
|
@Patrick-3000, thanks! |
* Enable list directory async for net framework (#1206) * Enable ListDirectoryAsync for .NET Framework * Removed (now) unused constant. * Remove placeholder tests (#1183) * Remove placeholder tests * Move Reverse perf test to benchmarks project --------- Co-authored-by: Wojciech Nagórski <[email protected]> * Fix integration test after moving test projects --------- Co-authored-by: Patrick-3000 <[email protected]> Co-authored-by: Rob Hague <[email protected]>
SSH.NET.nuspec needs to be updated to add dependency Microsoft.Bcl.AsyncInterfaces 7.0.0 when target net462 and netstandard2.0. |
Yes, IMO we should remove nuspec and AssemblyInfo and merge them into the csproj |
I drafted a new PR #1256 |
The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1 |
The Nuget package Renci.SshNet is available for .NET Framework. However, if you call
ListDirectoryAsync
on theSftpClient
, you will encounter aMethodNotFoundException
only at runtime.