[Libwebsockets] Client close example

Brenton Rothchild brentonr at dorm.org
Wed Apr 26 00:02:25 CEST 2017


I've tried looking for examples on this list or in documentation, but so
far I cannot find a good answer to the following question:

Can someone give a good example (simple, single threaded) where the client
sends a closing
reason to a WS server (any kind) with a reason using lws_close_reason()?

I am finding that with v2.1.0 and v2.2.1, I get sporadic results where
sometimes callling lws_close_reason() and returning -1 from the callback
will not actually send the close message payload and the socket is never
closed (as viewed using tcpdump).

I'm fairly positive I'm simply not using the library correctly, and would
very much appreciate a
concrete example where the client is closing the connection with a close

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20170425/990e4aaa/attachment.html>

More information about the Libwebsockets mailing list