3 ms·
Fair enough, but what happens if I open a page, send an Ajax call to say "add 1 user", then promptly close that page? I don't know what OP is doing to detect th
by nevi-me 10y ago
Fair enough, but what happens if I open a page, send an Ajax call to say "add 1 user", then promptly close that page? I don't know what OP is doing to detect that a user is no longer on the site.
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
- simplify 10y agoIt'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 :)