Skip to content

Cancalletion token and download callback in the SftpClient DownloadFileAsync / BeginDownloadFile? #1765

@synek317

Description

@synek317

Both methods call InternalDownloadFile, which accepts both a download callback and a cancellation token.

However:

  • DownloadFileAsync does not support a download callback.
  • BeginDownloadFile does not support a cancellation token.

Is there a specific reason for this design?

I'm struggling to implement a sequential download of multiple files with a global timeout (for example, a timeout that applies to the entire download process across all files) along with progress reporting. With the current API, this seems unnecessarily challenging.

Please note that I'm not a very advanced user of async in c#. If the above does not make sense, I would appreciate advice on how to do it better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions