[Libwebsockets] libuv loops

Andy Green andy at warmcat.com
Fri Apr 14 23:18:31 CEST 2017



On April 15, 2017 2:22:29 AM GMT+08:00, Joel Winarske <joel.winarske at gmail.com> wrote:
>Hi Andy,
>
>I'm seeing some trouble with uv_fs calls.  I am using the wsi - context
>-
>uv loop pointer.  A few of my writes work, then I get a pointer
>exception
>in libuv uv_process_async_wakeup_req().
>
>I don't see this problem with TCP I/O via the wsi - context - uv loop
>pointer.
>
>Should I be creating a separate loop for libuv file I/O?

Not as far as I know.

Close handling is tricky in libuv, that'd be the first suspect.  It has to go through two stages and the libuv loop must run to callback the handle close part... you have to call the right apis for the libuv type or you blow up... this isn't an lws thing but a libuv thing.

Since you are using platform fops, which has individual native plat implementations in lws, you can just not use libuv here in favour of the native file apis; there was no libuv in the fops up to now.  Libuv is good for when you only have one implementation, like the timers in the dumb-increment plugin, that you want to be cross-platform.

-Andy

>Thanks,
>Joel



More information about the Libwebsockets mailing list