[Libwebsockets] LWS_CALLBACK_PROTOCOL_DESTROY on live connection

Andy Green andy at warmcat.com
Sat Nov 19 09:44:57 CET 2016

On Sat, 2016-11-19 at 13:51 +0530, techi eth wrote:
> Hi,
> Sometime i will get LWS_CALLBACK_PROTOCOL_DESTROY on live connection.


> Could you please tell me in what cases PROTOCOL_DESTROY can come.

This is FOSS, you have the sources.  You don't have to ask someone else
or leave it as an unknown.

You should better grep the sources (or use, eg, Eclipse to do searches
across the whole sources) yourself, looking for anywhere the message
enum is used.

You would see that message is only sent in one place,
lws_context_destroy().  And that's after it has tried to close every
live wsi.  And that's after setting context->being_destroyed = 1, which
is a sign to not hope for a clean close but just free things and get

If there's some case missing, that is poking you in the eye, it'd be
really nice if you stepped up and debugged what is missing checking
context->being_destroyed, and sent me a patch fixing it, rather than a
question you could easily answer yourself.


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

More information about the Libwebsockets mailing list