[Libwebsockets] Callback when timeout during connection establishment ?

Andy Green andy at warmcat.com
Sat Aug 9 12:51:20 CEST 2014

On 9 August 2014 18:30:43 GMT+08:00, bjorka adinov <adinov.bjorka at gmail.com> wrote:
>Hello Sir,
>As far as I know there is no callback when connection timeouts during
>connection establishment. Is there a way to detect that a connection is
>timeout ?

Lws should cover all the stages of the connection, both as client trying to make the connection and server trying to process it, with an lws timeout.

If one of these times out, the socket will be closed.

Because no websocket upgrade was completed, there won't be a normal close callback.

You might get a LWS_CALLBACK_CLOSED_HTTP depending on when the connection failed.

Otherwise the connection will just be closed without the user callback getting informed.

Do you have a case where the user code needs to know about failed connection attempts?


>Thank you, much appreciated
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list