ForwardingHandler Class


class ForwardingHandler : public HandlerBase (.. public RefCountable, public NoCopy)
  bool Success() const;
  unsigned int GetListPort() const;
  ForwardingErr GetError() const;

  virtual void OnStart();
  virtual void OnDone();
  virtual void OnSuccess(unsigned int listPort);
  virtual void OnError(ForwardingErr const& error);


public class ForwardingHandler : IDisposable, HandlerBase (.. WaitImpl)
  public bool Success { get; }
  public uint GetListPort();
  public ForwardingErr GetError();
  public event StartEventHandler OnStart;
  public event DoneEventHandler OnDone;
  public event ForwardingSuccessEventHandler OnSuccess;
  public event ForwardingErrorEventHandler OnError;
  public override sealed bool IsDisposed { get; }
  public override sealed void Dispose();



  • Success: Request completed successfully?
  • GetListPort: Returns the listening port. This value is meaningful only with [Client]AddForwarding, when the forwarding has successfully been added, and the initiating forwarding rule had listening port set to 0 (use any port).
  • GetError: Returns a ForwardingErr.

Overrides and Events

  • OnStart: The first override/event being invoked for a request. *
  • OnDone: The last override/event being invoked for a request. *
  • OnSuccess: Invoked when the request was successful.
    • listPort: See GetListPort().
  • OnError: Invoked for a failed request.
    • error: See GetError().

[.NET] Disposing

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


This handler is used with the [Client]AddForwarding, [Client]CancelForwarding, and [Client]InviteForwardings requests.

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