void myqtt_ctx_set_on_msg ( MyQttCtx ctx,
MyQttOnMsgReceived  on_msg,
axlPointer  on_msg_data 

Allows to configure the on message handler at context level.

The handler configured here affects to all client connections receiving messages on this context that do not have a particular on message myqtt_conn_set_on_msg when this connection is acting as a client (not a MQTT broker).

Note that the handler configured at myqtt_conn_set_on_msg is called first, and if defined, makes the handler configured on this function (myqtt_ctx_set_on_msg) to be not called).

If you want to set a handler to get a notification at the server side (acting as a broker) for every message received see myqtt_ctx_set_on_publish

You can only configure one handler at time. Calling to configure a handler twice will replace previous one.

ctxThe context where the handler will be configured.
on_msgThe handler to be configured.
on_msg_dataUser defined pointer to be passed in into the on_msg when called.

References myqtt_mutex_lock(), and myqtt_mutex_unlock().