nabto_device_get_local_port()

DESCRIPTION

See nabto_device_set_local_port() for a description of local and p2p sockets.

Get the port number used by the local socket.

DECLARATION

NABTO_DEVICE_DECL_PREFIX NabtoDeviceError NABTO_DEVICE_API
nabto_device_get_local_port(NabtoDevice* device, uint16_t* port)

PARAMETERS

device:
[in] The device instance to perform action on
port:
[out] Reference port to set

RETURNS

  • NABTO_DEVICE_EC_OK: on success
  • NABTO_DEVICE_EC_INVALID_STATE: if the socket did not have a port