ProgressHandler Class


class ProgressHandler : public HandlerBase (.. public RefCountable, public NoCopy)
  bool Success() const;
  unsigned int GetTaskState() const;
  unsigned int GetTaskSpecificStep() const;
  std::wstring GetAuxInfo() const;

  virtual void OnStart();
  virtual void OnDone();
  virtual void OnProgress(unsigned int taskSpecificStep);
  virtual void OnSuccess();
  virtual void OnError(unsigned int taskSpecificStep, std::wstring const& auxInfo);


public class ProgressHandler : IDisposable, HandlerBase (.. WaitImpl)
  public bool Success { get; }
  public public TaskState GetTaskState();
  public uint GetTaskSpecificStep();
  public string GetAuxInfo();
  public event StartEventHandler OnStart;
  public event DoneEventHandler OnDone;
  public event ProgressEventHandler OnProgress;
  public event SuccessEventHandler OnSuccess;
  public event ProgressErrorEventHandler OnError;
  public override sealed bool IsDisposed { get; }
  public override sealed void Dispose();



  • Success: Request completed successfully?
  • GetTaskState: Returns a TaskState enumeration.
  • GetTaskSpecificStep: May return a ConnectStep or ClientSftpChannelOpenStep enumeration. **
  • GetAuxInfo: Returns an auxiliary info string. For failed requests this is a human-readable error description. Otherwise it is an empty string.

Overrides and Events

  • OnStart: The first override/event being invoked for a request. *
  • OnDone: The last override/event being invoked for a request. *
  • OnProgress: Invoked for [Client]Connect and [ClientSftpChannel]Open requests in order to report intermediate steps. These steps are reported right before they are processed.
    • taskSpecificStep: See GetTaskSpecificStep().
  • OnSuccess: Invoked when the request was successful.
  • OnError: Invoked for a failed request.
    • taskSpecificStep: See GetTaskSpecificStep().
    • auxInfo: See GetAuxInfo().

[.NET] Disposing

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


This handler is used with with a variety of [C++/.NET] requests to track their progress.

* [C++] Always call the base class implementation from your override.
** TaskSpecificStep only makes sense for the [Client]Connect and [ClientSftpChannel]Open requests. For all other requests it is irrelevant (the value is zero or undefined) and should not be evaluated.