nabto_client_tcp_tunnel_open()

DESCRIPTION

Opens a TCP tunnel to a TCP server through a Nabto enabled device connected to earlier. The ip address of the server is configured in the device. Often it is configured to localhost. <code> +--------+ +-----------+ +--------+ | nabto | nabto | nabto | tcp/ip | remote | |--+ client +----~~~---+ device +----~~~-----|--+ server | port | API | | | port | | +--------+ +----------+ +--------+ </code>

DECLARATION

NABTO_CLIENT_DECL_PREFIX void NABTO_CLIENT_API
nabto_client_tcp_tunnel_open(NabtoClientTcpTunnel* tunnel, NabtoClientFuture* future, const char* service, uint16_t localPort)

PARAMETERS

tunnel:
[in] Tunnel handle crated with nabto_client_tcp_tunnel_new.
future:
[in] The future.
service:
[in] The service on the remote host to connect to.
localPort:
[in] The local TCP port to listen on. If the localPort number is 0 the api will choose the port number.

RETURN VALUES

a future, when resolved the tunnel is either established or failed. If established, TCP clients can connect to the endpoint. Future status: NABTO_CLIENT_EC_OK if opening went ok 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 *

EXAMPLES

None.