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 withgetLocalPort()
.
ERRORS
T:Nabto.Edge.Client.NabtoException
: Thrown with error codeNOT_FOUND
if requesting an unknown service.T:Nabto.Edge.Client.NabtoException
: Thrown with error codeFORBIDDEN
if target device did not allow opening a tunnel to specified service for the current client.T:Nabto.Edge.Client.NabtoException
: Thrown with error codeSTOPPED
if the tunnel is stopped.T:Nabto.Edge.Client.NabtoException
: Thrown with error codeNOT_CONNECTED
if the connection is not established yet..T:Nabto.Edge.Client.NabtoException
: Thrown with error codePRIVILEGED_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.