** Added Issue as status PROPOSED type FEATURE **This is a discussion thread. Is there any interest in including a way to expose current transfer progress to an application? For example, imagine a user wanting to upload a file could pass in an implementation of: public interface IFileTransferHandler{ ulong BytesRead { get; } void IncrementBytesRead(ulong bytes); void TransferCompleted();} Whenever the callback for Write returns confirming that the bytes were written, IncrementReadBytes would be called and whenever the file is fully uploaded TransferCompleted gets called. Since we're passing in streams, there's no objective way to determine the file size so that would have to be provided in the implementation, if at all. All you really need to do is add a field for that interface in SftpFileStream and then pass it to all calls to RequestWrite and then create some new constructors so that the interface can be passed along from the publicly exposed methods (I've managed to build a sample implementation for sftp upload, so this method works). The only issue is if the handler throws an exception. Since it's asynchronous the debugger displays the stack trace in the wrong place and could confuse developers.
↧