axl_bool myqtt_storage_init ( MyQttCtx ctx,
MyQttConn conn,
MyQttStorage  storage 

Inits storage service for the provided client id.

You can use myqtt_storage_set_path to change default location. If nothing is provided on the previous function, the following locations are used to handle session storage:

  • ${HOME}/.myqtt-storage (if HOME variable is defined).
  • .myqtt-storage
ctxThe context where the operation takes place. Cannot be NULL.
connThe connection with a client identifier to init storage services. Cannot be NULL
storageStorage configuration to initialize
If the function is not able to create default storage, the function will fail, otherwise axl_true is returned. The function also returns axl_false in the case client_id is NULL or empty or the context is NULL too.

References myqtt_mutex_lock(), myqtt_mutex_unlock(), and myqtt_storage_init_offline().

Referenced by myqtt_conn_send_connect_reply(), and myqtt_storage_release_msg().