nabto_device_set_local_port()

DESCRIPTION

The device has two UDP sockets which is used for connection packets. One socket is used solely for local connections and one socket is used for internet facing p2p packets. These sockets are called the local socket and the p2p socket.

This function sets the port number which the local socket is bound to. If this function is not called the port number 5592 is used. If this option is set to 0 a free port is choosen by the system.

The port needs to be set before the function nabto_device_start() is called.

DECLARATION

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

PARAMETERS

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

RETURNS

NABTO_DEVICE_EC_OK on success