Re:Show HN: Real Time Users – Add a real-time user counter t...
by simplify on Friday June 10, 2016 @02:38PM
(#11878797)
It's a long-lived HTTP request. The server automatically knows if a client disconnects; that's a feature built into all HTTP server libraries everywhere.
But yes, if you're already using websockets for other features, there's no reason not to continue to use them, as you explained :)
The reasons why I used WebSockets are that I get a disconnect event immediately, and I was already using WebSockets for other features on the site