Server-sent events connection sharing?

Discussion in 'General' started by PSS, May 8, 2018.

  1. PSS

    PSS Well-Known Member

    A question:

    (Keepalive is on.)
    if I initiate server-sent events (SSE text/event-stream) for 2000 logged clients (every x secs data update per client), does lsws tie 2000 http connections for those (when waiting for data), or can it share existing ones?

    I could of course do the server side script "wrong format" and the automatic reconnect of SSE would then close it on error and start a new connection every x secs. This is like AJAX polling every x secs (but simpler), but I think that would re-use http connections, right?
  2. mistwang

    mistwang LiteSpeed Staff

    If keepalive timeout is longer than x seconds, then the connection belong to one client is more likely reused by that client. the connection cannot be shared among clients.

Share This Page