[Libwebsockets] lws_close_reason with "Max connection reached" message
thomas.spitz at hestia-france.com
Wed Jul 6 11:27:22 CEST 2016
When my lws server has reached its maximum of client, I am closing the
connection abruptly using return -1 on LWS_CALLBACK_ESTABLISHED.
I would like to give some further information to the client for the reason
why I do that.
I am trying to use lws_close_reason in the following way:
> unsigned char * closeReasonData = "MAX CONNECTION REACHED!";
But I get the following error:
> ws_close_reason: Assertion `wsi->mode == LWSCM_WS_SERVING || wsi->mode ==
> LWSCM_WS_CLIENT' failed.
I suppose I have to set LWSCM_WS_SERVING somewhere?
By the way is it appropriate to use LWS_CLOSE_STATUS_NORMAL and data for
this "Max connextion reached" purpose?
I am using master 2.0.0 from 2016/07/16
Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets