[Libwebsockets] Using websockets as a pure buffer manipulation engine.
andy at warmcat.com
Wed Nov 16 03:23:14 CET 2016
On Wed, 2016-11-16 at 08:46 +0800, Andy Green wrote:
> On Tue, 2016-11-15 at 14:59 -0500, Alan Conway wrote:
> > I had a look in docs etc. but cound't find an answer for this:
> > I want to add websocket support to a project that already has it's
> > own
> > multi-platform proactor, multi-SSL support etc. I would like to use
> > libwebsockets as a pure codec, dealing with just byte buffers from
> > my
> > own IO layer (which might not even use file descriptors in some
> > cases).
> > Is that possible?
> As it is, no. Lws can hook into someone else's existing event loop
> okay, and many people have done that over the years, but the lowest
> common denominator as it stands is a socketfd.
> Inside lws the stuff that actually touches the fds is isolated in a
> places and eg, pure external event loops are supported like libuv
> expose wrapped platform-specific objects instead of fds. So it's not
> out of the question to modify it to allow it.
> Still the most important event for lws is that the connection to the
> peer is "writeable", eg, POLLOUT from poll(). In all the ways to use
> lws this provides the basic heartbeat for the sequencing. Is that an
> event that fits into your picture?
... and thinking about it RX flow control management, that lws controls
whether pending RX packets remain unread by POLLIN control or other
similar scheme, is also indispensable for a practical system.
> > Thanks,
> > Alan.
> > _______________________________________________
> > Libwebsockets mailing list
> > Libwebsockets at ml.libwebsockets.org
> > http://libwebsockets.org/mailman/listinfo/libwebsockets
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
More information about the Libwebsockets