[Libwebsockets] Example of custom event loop integration?
felipe at felipegasper.com
Sun May 30 02:35:14 CEST 2021
> On May 29, 2021, at 8:21 PM, Felipe Gasper <felipe at felipegasper.com> wrote:
> I’m considering writing a Perl binding to libwebsockets. For this to work I need to be able to integrate libwebsockets into whatever event loop the Perl application runs. (There are many loops, and three widely-used abstraction interfaces over them.)
> I found the HTTP-server foreign event lib integration example: https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c
> This example, though, appears only to use event libraries that libwebsockets natively supports. Does libwebsockets include an interface like libcurl’s multi_socket interface (cf. https://curl.se/libcurl/c/libcurl-multi.html)? That seems to be what `struct lws_event_loop_ops` and `struct lws_plugin_evlib` represent … are there any examples of giving these structs to libwebsockets at runtime?
I believe I’ve found what I need at https://libwebsockets.org/lws-api-doc-master/html/md_README_8coding.html and in test-server.c in the source tree.
More information about the Libwebsockets