mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
![]() 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. |
||
---|---|---|
.. | ||
android | ||
private | ||
.gitignore | ||
attack.sh | ||
candide.zip | ||
favicon.ico | ||
fuzxy.c | ||
http2.png | ||
leaf.jpg | ||
libwebsockets-test-server.service | ||
libwebsockets.org-logo.png | ||
lws-cgi-test.sh | ||
lws-common.js | ||
lws-ssh-test-keys | ||
lws-ssh-test-keys.pub | ||
test-client.c | ||
test-echo.c | ||
test-fraggle.c | ||
test-lejp.c | ||
test-ping.c | ||
test-server-dumb-increment.c | ||
test-server-http.c | ||
test-server-libev.c | ||
test-server-libevent.c | ||
test-server-libuv.c | ||
test-server-pthreads.c | ||
test-server-v2.0.c | ||
test-server.c | ||
test-server.h | ||
test-sshd.c | ||
test.html | ||
wss-over-h2.png |