1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-23 00:00:06 +01:00
libwebsockets/lib
Andy Green 1820212724 lws_set_timer_usecs: change to usec resolution
This replaces the existing, unreleased lws_set_timer(wsi, secs) with
lws_set_timer_usecs(wsi, usecs).

wsi with a timer waiting are added to a linked-list sorted by the
timer trigger time.

1) poll() timeout (ie, poll wait) is trimmed to the nearest ms of the
first waiting timer if the default poll wait is longer than the
interval until the first waiting timer.

The linked-list of waiting timers is checked every entry and exit
from poll()... if no timers waiting or none reached their time
this costs almost nothing.

2) libuv: the earliest hrtimer is checked after every IO, again this
is costing nothing if the list head is NULL.  If the case there
are hrtimers on the list, it costs a getimeofday (a VDSO in linux)
and more only if any of the timers have fired.

In addition on entry to libuv idle, if there are any waiting hrtimers
on the list, a libuv timer is used to force a wake in case we stay
idle (the libuv timer has ms resolution).

3) libev: not implemented

4) libevent: not implemented

Warnings are logged in the api is used on an event backend without
support.  Patches welcome to add support similarly to libuv.
2018-04-06 10:38:03 +08:00
..
client coverity 188316: supposed deadcode 2018-04-06 10:38:03 +08:00
event-libs lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00
ext minimal-examples: add ws pmd example 2018-03-06 09:39:27 +08:00
http2 h2 ws: fixes against chrome 2018-04-06 10:38:02 +08:00
jws lws_snprintf 2018-03-12 09:28:42 +08:00
misc esp32: map basic auth to nvs 2018-02-24 08:14:17 +08:00
plat lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00
server minimal: minimal-raw-adopt-tcp 2018-04-06 10:38:03 +08:00
tls client: choose right vh client ssl_ctx 2018-04-06 10:38:03 +08:00
alloc.c acme: adaptations through plat for esp32 2017-12-11 13:30:12 +08:00
context.c valgrind: context creation error path 2018-04-06 10:38:03 +08:00
handshake.c h2 ws: fixes against chrome 2018-04-06 10:38:02 +08:00
header.c minimal: dynamic http server 2018-04-06 10:38:03 +08:00
lextable-strings.h parser: add x-auth-token 2017-12-01 11:37:36 +08:00
lextable.h parser: add x-auth-token 2017-12-01 11:37:36 +08:00
libwebsockets.c lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00
libwebsockets.h lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00
minilex.c whitespace trailing mass cleanout 2015-12-14 08:52:03 +08:00
output.c align private LWS_NO_EXTENSIONS to be same as public LWS_WITHOUT_EXTENSIONS 2018-04-06 10:38:03 +08:00
pollfd.c h2 ws: fixes against chrome 2018-04-06 10:38:02 +08:00
private-libwebsockets.h lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00
service.c lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00