Back to FlowSsh Documentation

ForwardingHandler Class

[C++]

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

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

[C#]

public class ForwardingHandler : IDisposable (.. : 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();
}

Members

General

  • 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.
    Parameters:
    • listPort: See GetListPort().
  • 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

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

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