Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6012615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:25:47+00:00 2026-05-23T02:25:47+00:00

I am working with socket.io and node.js. I’m am having problems tracking which users

  • 0

I am working with socket.io and node.js. I’m am having problems tracking which users are online because of the few seconds delay before socket IO recognises an XHR-Polling client has disconnected.

If an XHR-Polling client refreshes the page their new connection message seems to precede their disconnection message. This causes confusion when trying to track which users are online.

One solution could be to detect the transport method on the serverside and delay the connection for XHR-Polling clients to ensure that the disconnection functions have been run first.

Has anyone had any experience of this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:25:47+00:00Added an answer on May 23, 2026 at 2:25 am

    The main problem with presence, as @davin and @jcolebrand point out in the comments, is that connections alone can’t be relied upon. Network devices can hold on to connections after a user has navigated away from a page. So, you need something else in place to confirm a users presence.

    This is something we’ve added support for in Pusher and we do this using something called Presence Channels.

    We manage this using a unique user id, which you (the developer) have to supply when a user connects, in combination with a unique socket id which identifies the connection. Since this unique user id can only occur once within a presence member list it means that that user will only be listed once – even if they have multiple connections open, and thus multiple socket connections.

    The same idea can be applied to HTTP connections.

    The general approach for this is to use the session to uniquely identify the user. In that way even if they are just a “Guest” you can still identify them as long as they are allowing the use of cookies.

    So, the number of users on your system should only ever max at the number of active sessions you have running on your server.

    Hope this helps. Let me know if you’d like anything clarified.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
I am working with Node.js to build a web socket server that uses mongodb.
I am working on a server application which receives data over a TCP socket
Currently I have the following code, working with Node.js, socket.io and Redis: var io
While working on a larger project, a few lines of code using java.net.Socket failed
I'm working with socket.io and node.js and until now it seems pretty good, but
I'm trying to get a multicast socket working on a 'server' app, which will
I'm having issues getting a simple server/client socket app working in C# between two
I have recently been working on a nodejs app which uses open socket connections
I am working on a tcp/ip socket listener which listens on port 80 for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.