[Libwebsockets] Callback when timeout during connection establishment ?

bjorka adinov adinov.bjorka at gmail.com
Mon Aug 11 17:56:47 CEST 2014


Not real world case. I only simulate a case where the server is doing
something that might take several seconds between libwebsocket_service
calls, if the connection times out I try to reconnect.

Thank you


On Sat, Aug 9, 2014 at 5:51 PM, Andy Green <andy at warmcat.com> wrote:

>
>
> 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?
>
> -Andy
>
> >Thank you, much appreciated
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Libwebsockets mailing list
> >Libwebsockets at ml.libwebsockets.org
> >http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20140811/4adc439c/attachment-0001.html>


More information about the Libwebsockets mailing list