nabto_device_stream_init_listener()

DESCRIPTION

Initialize a listener for new streams on a given port. A port can only have one listener.

DECLARATION

NABTO_DEVICE_DECL_PREFIX NabtoDeviceError NABTO_DEVICE_API
nabto_device_stream_init_listener(NabtoDevice* device,
                                  NabtoDeviceListener* listener,
                                  uint32_t port)

PARAMETERS

device:
[in] device
listener:
[in] Listener to initialize for streaming
port:
[in] A number describing the id/port of the stream to listen for. Think of it as a demultiplexing port number.

RETURN VALUES

NABTO_DEVICE_EC_OK on success NABTO_DEVICE_EC_OUT_OF_MEMORY if underlying structure could not be allocated NABTO_DEVICE_EC_OPERATION_IN_PROGRESS if the port number has an active listener

EXAMPLES

None.