-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoupling the websocket protocol from the transport layer #3148
Comments
We do have custom event lib support, where you can tell lws to handle socket events on an abstracted "event library", which can be you own implementation. I'm not sure if that's enough for this or not. Eg, |
Thanks for the quick reply. I am not sure if I understand the example, but one thing I certainly cannot do is to dedicate a thread to lws_service(). That way it will either occupy a core or incur a context switching overhead. My application is single threaded where it does all its work. Ideally, what I want to be able to do is this: |
... nothing about this requires a dedicated thread. In fact it requires a single-threaded event loop.
I'm afraid we're in the parallel universe where I wrote this 13 years ago without any reference to you, or your ideals you might arrive at in 2024. You're welcome to use or modify what's available, but nobody's going to rewrite it to your specifications for free. |
I certainly did not want you to rewrite it. I just thought you could let me know if there is something already there which could help me achieve similar to what I want. I am sure you would have come up with something better if you like the idea of decoupling the websocket protocol from the transport layer. |
It's better to spend a bit more serious time understanding the custom event loop stuff (eg, that it is unrelated to any separate thread) that I did suggest. You're basically making an event library along the lines of libuv etc and that is how to interface to such a thing. |
@lws-team |
Hi team,
I would like to use libwebsockets with my own transport layer which is based on io_uring. Basically, I have a io_uring completion events based (single threaded) main loop (which runs a state machine) with non blocking socket calls. Is it possible with libwebsockets? Do you have any future plans to decouple the the websocket protocol from the transport layer?
Thank you.
The text was updated successfully, but these errors were encountered: