[Libwebsockets] HTTP keep alive timeout set to 31sec

Andy Green andy at warmcat.com
Wed Feb 13 07:38:45 CET 2019



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


More information about the Libwebsockets mailing list