[Libwebsockets] CPU 100% usage due to constant writeable callbacks
tegteg at gmail.com
Fri Jul 27 22:41:17 CEST 2018
I have a websocket client application based on the test app.
Once I connect to the server I need to send it a subscription message
telling it what data to send me.
So in the LWS_CALLBACK_CLIENT_ESTABLISHED callback I call
I then immediately get a LWS_CALLBACK_CLIENT_WRITEABLE callback and I call
lws_write which succeeds.
After this I am done writing for the duration of the process.
But I continue to constantly get writeable callbacks which I ignore as I
have nothing more to write.
so the program works fine but it pegs the CPU at 100% because it is
constantly calling writeable callback.
Do I have to cancel the writeable callback somehow? I am calling
lws_service with 1000 ms timeout but this function is returning immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets