[Libwebsockets] Using websockets as a pure buffer manipulation engine.

Andy Green andy at warmcat.com
Wed Nov 16 01:46:00 CET 2016


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 few
places and eg, pure external event loops are supported like libuv that
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?

-Andy

> Thanks,
> Alan.
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://libwebsockets.org/mailman/listinfo/libwebsockets



More information about the Libwebsockets mailing list