Introduce global timed handlers

There are situations when applications need more predictable timed
handlers that don't depend on connection status. Other usecase of
the global handlers is to manage offline connections, for example,
reconnect after a disconnection.
This commit is contained in:
Dmitry Podgorny
2020-06-03 02:11:40 +03:00
parent cba21b5598
commit 3dcc5a60f2
5 changed files with 131 additions and 78 deletions

View File

@@ -419,6 +419,7 @@ xmpp_ctx_t *xmpp_ctx_new(const xmpp_mem_t *const mem,
ctx->log = log;
ctx->connlist = NULL;
ctx->timed_handlers = NULL;
ctx->loop_status = XMPP_LOOP_NOTSTARTED;
ctx->rand = xmpp_rand_new(ctx);
ctx->timeout = EVENT_LOOP_DEFAULT_TIMEOUT;