MyQttConn * myqtt_listener_new ( MyQttCtx ctx,
const char *  host,
const char *  port,
MyQttConnOpts opts,
MyQttListenerReady  on_ready,
axlPointer  user_data 

Allows to start a MQTT server on the provided local host address and port.

Important note: you must call to myqtt_storage_set_path to define the path first before creating any listener. This is because creating a listener activates all server side code which among other things includes the storage loading (client subscriptions, offline publishing, etc). In the case direction, once the storage path is loaded it cannot be changed after restarting the particular context used in this operation (MyQttCtx).

ctxThe context where the operation takes place.
hostThe local host address to list for incoming connections.
portThe local port to listen on.
optsOptional connection options to modify default behaviour.
on_readyOptional on ready notification handler that gets called when the listener is created or a failure was found. Providing this handler makes this function to not block the caller.
user_dataOptional user defined pointer that is passed into the on_ready function (in the case the former is defined too).
A reference to a newly created MyQttConn object representing a listener (MyQttRoleMasterListener - myqtt_conn_get_role). Check that the listener was properly created by calling to myqtt_conn_is_ok

References MYQTT_IPv4.