void myqtt_ctx_set_on_connect ( MyQttCtx ctx,
MyQttOnConnectHandler  on_connect,
axlPointer  user_data 
)

Allows to configure the handler that will be called to delegate decision about CONNECT requests received.

Parameters
ctxThe context that will be configured.
on_connectThe handler that will be configured.

This function differs from myqtt_listener_set_on_connection_accepted in the sense that the handler configured in this function is called when CONNECT MQTT package has been received and fully parsed while the handler configured at myqtt_listener_set_on_connection_accepted is called when the connection has been just received (but no protocol negotiation has taken place).

Parameters
user_dataUser defined pointer that will be passed in into the handler when called.

References myqtt_mutex_lock(), and myqtt_mutex_unlock().