void myqtt_conn_set_on_close ( MyQttConn connection,
axl_bool  insert_last,
MyQttConnOnClose  on_close_handler,
axlPointer  data 
)

Allows to set a new on close handler to be executed only once the connection is being closed.

The handler provided on this function is called once the connection provided is closed. This is useful to detect connection broken or "broken pipe".

Parameters
connectionThe connection being closed
on_close_handlerThe handler that will be executed.
dataUser defined data to be passed to the handler.
insert_lastAllows to configure if the handler should be inserted at the last position.

NOTE: handler configured will be skipped in the case MyQttCtx hosting the provided connection is being closed (a call to myqtt_exit_ctx was done).

References myqtt_mutex_lock(), and myqtt_mutex_unlock().

Referenced by myqtt_conn_get_next(), and myqttd_conn_mgr_setup_proxy_on_parent().