[Libwebsockets] Identify SSE connection close from frontend
andy at warmcat.com
Thu Apr 18 13:25:16 CEST 2019
On 18/04/2019 19:18, Choxmi Sathsara wrote:
> I'm using LWS SSE to broadcast data. Since there is a limitation of number of SSE connections for a browser, I need to close SSE connections on number of SSE connections exceed the limit.
> Even though I close the connection by returning 1, the frontend connection remains. I tried with `eventsource.onerror` and `CLOSED` state of `eventsource.readystate`. But non of them get triggered.
Where are you return 1 from, ie, which callback?
> But when I terminate the backend process, `onerror` get triggered. What am I doing wrong? Is there any way to terminate the connection?
> Any help would be much appreciated.
Is there a convenient way I can reproduce it, eg, using a modified SSE
> Thanks and regards,
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
More information about the Libwebsockets