[Libwebsockets] Client timeout setting for very slow server

Andy Green andy at warmcat.com
Thu Feb 14 19:25:53 CET 2019

On February 14, 2019 9:29:57 PM GMT+08:00, "Gerard Juijn (Ingenico Partner)" <Gerard.Juijn at epay.ingenico.com> wrote:
>We have a service running (that is not using libwebsockets and outside
>of our control) which takes a long time to respond.
>When I connect to it from libwebsockets I get the
>LWS_CALLBACK_CLIENT_CONNECTION_ERROR reason in our callback after about
>25 seconds after initiating the GET request.
>Is there a way to expand the timeout for a slow server?
>I tried the lws_set_timeout() function but that doesn't seem to fix the
>Any other place to set a timeout value that I overlooked?


If not, can you send detailed lws logs around this connection attempt?

Depending on at which point the server forces you to wait, and your platform, the tcp connection action itself may not be being accepted for long enough to time out at that level.



More information about the Libwebsockets mailing list