MyQttCtx* myqtt_ctx_new ( void  )

Creates a new myqtt execution context.

This is mainly used by the main module (called from myqtt_init_ctx) and finished from myqtt_exit_ctx.

A context is required to make myqtt library to work. This object stores a single execution context. Several execution context can be created inside the same process.

After calling to this function, a new MyQttCtx is created and all configuration required previous to myqtt_init_ctx can be done. Once prepared, a call to myqtt_init_ctx starts myqtt library.

Once you want to stop the library execution you must call to myqtt_exit_ctx.

See http://lists.aspl.es/pipermail/myqtt/2008-January/000343.html for more information.

Returns
A newly allocated reference to the MyQttCtx. You must finish it with myqtt_ctx_free. Reference returned must be checked to be not NULL (in which case, memory allocation have failed).

References MYQTT_CHECK_REF, MYQTT_CHECK_REF2, myqtt_cond_create(), myqtt_hash_new(), and myqtt_mutex_create().

Referenced by myqttd_init().