TransferHandler Class

[C++]

class TransferHandler : public HandlerBase (.. public RefCountable, public NoCopy)
{
public:
  bool Success() const;
  FlowSshC_TransferStat GetTransferStat() const;
  TransferErr GetError() const;

protected:
  virtual void OnStart();
  virtual void OnDone();
  virtual void OnTransfer(bool done, FlowSshC_TransferStat const& transferStat);
  virtual void OnError(TransferErr const& error);
}

[C#]

public class TransferHandler : IDisposable, HandlerBase (.. WaitImpl)
{
  public bool Success { get; }
  TransferStat GetTransferStat();
  public TransferErr GetError();
  
  public event StartEventHandler OnStart;
  public event DoneEventHandler OnDone;
  public event TransferEventHandler OnTransfer;
  public event TransferErrorEventHandler OnError;
  
  public override sealed bool IsDisposed { get; }
  public override sealed void Dispose();
}

Members

General

  • Success: Request completed successfully?
  • GetTransferStat: Returns a TransferStat with information about the requested download/upload.
  • GetError: Returns a TransferErr.

Overrides and Events

  • OnStart: The first override/event being invoked for a request. *
  • OnDone: The last override/event being invoked for a request. *
  • OnTransfer: Invoked to pass information about the download/upload state to you.
    Parameters:
    • transferStat: See GetTransferStat().
  • OnError: Invoked for a failed request.
    Parameters:
    • error: See GetError().

[.NET] Disposing

  • IsDisposed: Is the object disposed?
  • Dispose: Release all resources used by the object.

Remarks

TransferHandler is a base class which must be derived to use. Either derive and implement your own OnDone() method, or use pre-made derived classes TransferEvent or TransferMsg (for Win32 graphical applications). If you use TransferEvent, call WaitDone() or wait for GetDoneEvent() before checking the result.

This handler is used with with the [ClientSftpChannel]Download and [ClientSftpChannel]Upload requests.

* [C++] Always call the base class implementation from your override.