[Libwebsockets] External poll and listener usage

Vitaliy Aleksandrov vitalik.voip at gmail.com
Thu Feb 9 16:54:10 CET 2017

Hello, libwesockets community.

I'm planning to use libwesockets to add WS support to an existing server
application with its existing event loop (poll) and listening socket.
External poll integration looks quite simple and test server provided with
sources is a good example. As I've already mentioned my server accepts
clients connections itself.
*lws_adopt_socket()* does the job and lws successfully adopts provided fd.
Since I don't use lws internal listener I wanted to turn it off and found
two lws context options: CONTEXT_PORT_NO_LISTEN
and CONTEXT_PORT_NO_LISTEN_SERVER (not in 2.1 stable).

Documentation about mentioned options is not clear for me. I
tried CONTEXT_PORT_NO_LISTEN_SERVER with the latest master branch
and CONTEXT_PORT_NO_LISTEN with the 2.1 stable and in both cases my test
HTTP (not ws yet) server didn't start internal listener and took provided
client's fd without any problems. So what is the real difference between
them for a WS server?

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20170209/e0f0d6d5/attachment.html>

More information about the Libwebsockets mailing list