[Libwebsockets] libuv loops
joel.winarske at gmail.com
Sat Apr 15 00:09:23 CEST 2017
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
> >in libuv uv_process_async_wakeup_req().
> >I don't see this problem with TCP I/O via the wsi - context - uv loop
> >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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets