ITcpTunnel.OpenAsync()

DESCRIPTION

Open this tunnel without blocking. The returned task can fail with:

DECLARATION

System.Threading.Tasks.Task OpenAsync(System.String, UInt16)

PARAMETERS

  • service: The service to connect to on the remote device (as defined in the device’s configuration), e.g. “http”, “http-admin”, “ssh”, “rtsp”.
  • localPort: The local port to listen on. If 0 is specified, an ephemeral port is used, it can be retrieved with getLocalPort().

ERRORS

  • T:Nabto.Edge.Client.NabtoException: Thrown with error code NOT_FOUND if requesting an unknown service.
  • T:Nabto.Edge.Client.NabtoException: Thrown with error code FORBIDDEN if target device did not allow opening a tunnel to specified service for the current client.
  • T:Nabto.Edge.Client.NabtoException: Thrown with error code STOPPED if the tunnel is stopped.
  • T:Nabto.Edge.Client.NabtoException: Thrown with error code NOT_CONNECTED if the connection is not established yet..
  • T:Nabto.Edge.Client.NabtoException: Thrown with error code PRIVILEGED_PORT if the connection is not established because the port is privileged and the user does not have access to start a listening socket on that port number.

RETURNS

The Task that will complete once the tunnel is opened.