1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/plugins
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
..
acme-client lws_snprintf 2018-03-12 09:28:42 +08:00
generic-sessions lws_snprintf 2018-03-12 09:28:42 +08:00
generic-table lws_snprintf 2018-03-12 09:28:42 +08:00
ssh-base lws_snprintf 2018-03-12 09:28:42 +08:00
lwsws-logo.png http cache policy 2016-04-22 08:53:49 +08:00
protocol_client_loopback_test.c lws_snprintf 2018-03-12 09:28:42 +08:00
protocol_dumb_increment.c lws_set_timer_usecs: change to usec resolution 2018-04-06 10:38:03 +08:00
protocol_esp32_lws_group.c plugins: group 2017-05-16 20:21:47 +08:00
protocol_esp32_lws_ota.c lws_snprintf 2018-03-12 09:28:42 +08:00
protocol_esp32_lws_reboot_to_factory.c esp32: separate factory setup 2017-03-31 20:05:10 +08:00
protocol_esp32_lws_scan.c lws_snprintf 2018-03-12 09:28:42 +08:00
protocol_lws_meta.c appveyor: Enable 64-bit build with OpenSSL and HTTP2 2017-11-26 19:16:17 +08:00
protocol_lws_mirror.c coverity 188310: mirror plugin: when reach max mirror instances release lock before disconnect 2018-04-06 10:38:03 +08:00
protocol_lws_raw_test.c minimal: minimal-raw-file 2018-04-06 10:38:03 +08:00
protocol_lws_server_status.c http2: make usable 2017-10-16 17:13:49 +08:00
protocol_lws_sshd_demo.c win32: remove snprintf mangling 2018-03-09 08:49:59 +08:00
protocol_lws_status.c wss-over-h2: show feedback in test page if active 2018-04-06 10:38:03 +08:00
protocol_post_demo.c lws_snprintf 2018-03-12 09:28:42 +08:00
server-status.html http2: make usable 2017-10-16 17:13:49 +08:00