[Libwebsockets] LWS_CALLBACK_CLIENT_CONNECTION_ERROR handling with external polling?

Matt Sarnoff matt.sarnoff at gmail.com
Sun Jan 17 01:53:17 CET 2016

I'm currently using libwebsockets 1.6.0 in a client application with an
external polling mechanism provided by a libuv event loop. I'm not calling
lws_service() at all.

I'm finding that I never receive LWS_CALLBACK_CLIENT_CONNECTION_ERROR for
connection timeouts, e.g. if I specify a nonexistent host name. If I call
lws_service() in a loop, I receive the callback after about 5 seconds, as

My current solution involves calling lws_client_connect_via_info(), then
calling lws_service() periodically from a uv_timer_t
until LWS_CALLBACK_CLIENT_ESTABLISHED is received or the connection fails.
Is there a better way to handle this scenario?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20160116/b48d664f/attachment.html>

More information about the Libwebsockets mailing list