[Libwebsockets] HTTP keep alive timeout set to 31sec

Xi Chen leon6827chix at gmail.com
Wed Feb 13 08:28:31 CET 2019


Andy,

I am using LWS as HTTP2 client to connect with Alexa service.
Alexa cloud service requires client to send PING every 300 second.
Let's say I am going to send PING at t=300sec, but will receive LWS timeout
at t=31sec due to this logic.
Is this expected?

-Xi

On Tue, Feb 12, 2019 at 10:38 PM Andy Green <andy at warmcat.com> wrote:

>
>
> On February 12, 2019 1:05:51 PM PST, Xi Chen <leon6827chix at gmail.com>
> wrote:
> >Hi Andy,
> >
> >     /* let the network wsi live a bit longer if subs are active...
> >
> >      * our frame may take a long time to chew through */
> >
> >     if (!wsi->ws_over_h2_count)
> >
> >         lws_set_timeout(wsi, PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE, 31);
> >
> >
> >
> >What is the logic behind this? Any reason using the fixed value 31?
> >
> >Im seeing a timeout due to this.
>
> An idle h2 connection with no ws streams, ie, just idle h2 streams, will
> disconnect the nwsi after 30s idle.
>
> If any h2 stream carried by the nwsi does something, it'll extend the
> network wsi timeout by 30s again.
>
> Ws streams are immortal (at least timeoutwise) once established, and
> confer that immortality on the network wsi carrying them.
>
> What are you doing where this is a problem?
>
> -Andy
>
> >
> >Thanks
> >
> >Xi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20190212/9cb66042/attachment-0001.html>


More information about the Libwebsockets mailing list