strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

xmpp_ctx_set_timeout does not work ? (stophe 0.9.3) #167

Closed dev31337 closed 3 years ago

dev31337 commented 3 years ago

Setting xmpp_ctx_set_timeout(ctx,50) has no effect on xmpp_run(ctx) which never times out (never returns).

dev31337 commented 3 years ago

Solved by using xmpp_run_once() instead :)

pasis commented 3 years ago

xmpp_run() runs the event loop until xmpp_stop() is called. xmpp_ctx_set_timeout() controls timeout for I/O event notification within xmpp_run() -- it doesn't affect xmpp_run_once().

You need to choose between xmpp_run() and xmpp_run_once() depending on your use-case. examples/bot.c shows how to write a program with xmpp_run().