You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to integrate libwebsockets into a project with a custom io_uring+epoll loop... and mostly managed to connect the pieces similar to minimal-http-server-eventlib-custom example from the repository.
I am registering libwebsockets fds, with my epoll, and then use lws_service_fd() to service those fds on set events in individual callbacks.
If I understood correctly, I have to check if lws_service_adjust_timeout() gives me a 0, then there is a "forced service" needed and I should then call lws_service_tsi() with a timeout of -1 ... but the eventlib-custom example does not seem to be doing that explicitly.
Can you please clarify whether a call to lws_service_tsi(context, -1, 0) is needed? or why it is missing from the mentioned example?
Thanks.
-- Alexey
The text was updated successfully, but these errors were encountered:
I think forced service is handled internally for a while.
Originally there was an explicit service loop needed in user code because we went around it after every event. But for a while that has been changed to stay in the service call until we exit the event loop wholesale, this is aligned to how real event libs work, you start the event loop and don't come back from that until the loop ends, you just get callbacks from the events.
So there's now a loop in lws_service_tsi() with calculated max waits considering suls, it knows about forced service (essentially more work to do, but there won't be any more fd events to trigger it) and just goes again immediately.
External poll is very old and should have been deprecated years ago, it's disabled by default for good reasons. Custom event lib is the modern way that is much better.
Hi @lws-team,
I am trying to integrate libwebsockets into a project with a custom io_uring+epoll loop... and mostly managed to connect the pieces similar to minimal-http-server-eventlib-custom example from the repository.
I am registering libwebsockets fds, with my epoll, and then use lws_service_fd() to service those fds on set events in individual callbacks.
It seems like I ran into a problem of "forced service" as mentioned in https://github.com/warmcat/libwebsockets/blob/v4.3-stable/READMEs/README.coding.md (@section extpoll).
If I understood correctly, I have to check if lws_service_adjust_timeout() gives me a 0, then there is a "forced service" needed and I should then call lws_service_tsi() with a timeout of -1 ... but the eventlib-custom example does not seem to be doing that explicitly.
Can you please clarify whether a call to lws_service_tsi(context, -1, 0) is needed? or why it is missing from the mentioned example?
Thanks.
-- Alexey
The text was updated successfully, but these errors were encountered: