1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

websocket: actively cancel lws_service() / poll() when new data is to be sent

This commit is contained in:
Steffen Vogel 2021-04-27 18:49:50 +00:00
parent 5c2fbad0b1
commit 82f911bf0c

View file

@ -164,7 +164,7 @@ void Web::worker()
logger->info("Started worker");
while (running) {
lws_service(context, 10);
lws_service(context, 0);
while (!writables.empty()) {
wsi = writables.pop();
@ -291,4 +291,5 @@ void Web::stop()
void Web::callbackOnWritable(lws *wsi)
{
writables.push(wsi);
lws_cancel_service(context);
}