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

PROBLEM : I am having problems getting socket.IO to connect in some circumstances, so
I am wondering if it is possible to have a socket with send which
hi had a working phpmyadmin which stopped working when i installed a new version
I'm working on a project in C# w/ XNA, and I want to reorganize
While working with the sockets library in python 2.7, I am encountering an issue
After asking so many question about android socket programming and getting valuable answers from
I'm working on an app for Windows CE 5.0 , by .NET CF 3.5
I'm working on a general server and a client programs. The problem I'm facing
I have some code that I'm using to get data from a network socket.
Have been asked to print to a remote printer via a socket connection, and

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.