TcpTunnel.open()

DESCRIPTION

Open this tunnel. Blocks until the tunnel is ready to use or an error occurs.

DECLARATION

    public func open(service: String, localPort: UInt16) throws 

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

Throws the following errors:

NABTO_CLIENT_EC_NOT_FOUND:
if requesting an unknown service.
NABTO_CLIENT_EC_FORBIDDEN:
if target device did not allow opening a tunnel to specified service for the current client

RETURN VALUES

None.

EXAMPLES

None.