[Libwebsockets] TIMEDOUT event while connection

Andy Green andy at warmcat.com
Mon Jan 2 08:25:02 CET 2017



On January 2, 2017 2:43:25 PM GMT+08:00, techi eth <techieth at gmail.com> wrote:
>Hi,
>
>
>
>I was facing some issue during connection with server from client. I
>was
>getting below timedout event.
>
>
>
>NOTICE: wsi 0x4b2a78: TIMEDOUT WAITING on 17 (did hdr 1, ah (nil), wl
>0,
>pfd events 1)
>
>NOTICE: wsi 0xb4f6b100: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x5bd358,
>wl
>0, pfd events 5)
>
>NOTICE: wsi 0x4b2738: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x5be17c, wl
>0,
>pfd events 5)
>
>NOTICE: wsi 0xb4f6e8f8: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x5befa0,
>wl
>0, pfd events 5)
>
>NOTICE: wsi 0x5e5c00: TIMEDOUT WAITING on 2 (did hdr 0, ah 0x5bfdc4, wl
>0,
>pfd events 5)
>
>NOTICE: lws_header_table_attach: adding 0x5e4a78 to ah waiting list

If the server is very busy, you might increase the size of the ah pool in the context creation info struct

short max_http_header_pool;
	/**< CONTEXT: The max number of connections with http headers that
	 * can be processed simultaneously (the corresponding memory is
	 * allocated for the lifetime of the context).  If the pool is
	 * busy new incoming connections must wait for accept until one
	 * becomes free. */

>
>
>I need help on below points to understand issue.
>
>·         What could be probable reason for TIMEDOUT

The reason is given in "on 2" or "on 17"

https://github.com/warmcat/libwebsockets/blob/master/lib/libwebsockets.h#L3166

>Is there any way I can increase AWAITING_TIMEOUT time.

You can set it in the context creation info struct

unsigned int timeout_secs;
	/**< VHOST: various processes involving network roundtrips in the
	 * library are protected from hanging forever by timeouts.  If
	 * nonzero, this member lets you set the timeout used in seconds.
	 * Otherwise a default timeout is used. */

-Andy



More information about the Libwebsockets mailing list