[Libwebsockets] libuv loops

Joel Winarske joel.winarske at gmail.com
Sat Apr 15 00:09:23 CEST 2017

Hi Andy,

It happens long before the close.  I have a large chunked file, and I write
each incoming response to disk.  About three writes in, it blows up.

Ultimately I need to cache files to a temp directory.  If lws supported fs
write(), nftw(), etc I would certainly use it.


On Fri, Apr 14, 2017 at 2:18 PM, Andy Green <andy at warmcat.com> wrote:

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20170414/594af7c2/attachment-0002.html>

More information about the Libwebsockets mailing list