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

  • Home
  • SEARCH
  • 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 9205109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:52:30+00:00 2026-06-17T23:52:30+00:00

This is executed for each cluster process using https://github.com/fent/socket.io-clusterhub : var store = new

  • 0

This is executed for each cluster process using https://github.com/fent/socket.io-clusterhub:

var store = new (require('socket.io-clusterhub'));
var io = require('socket.io').listen(config.ports.socket);
io.configure(function(){
    io.set('store',store);
});
console.log('Socket service listening on port '+config.ports.socket);
io.sockets.on('connection',function(socket){
    if(typeof fn === 'function'){fn(socket);}
});

But it looks like all 4 threads are attempting to register the same user with different socket id’s:

debug: client authorized
info: handshake authorized XEGx6zAP7rSWGQcaxmUB
debug: client authorized
info: handshake authorized r0Vcr7Z-r_9MnylyxmUC
debug: client authorized
info: handshake authorized 7RWUgoCuZPIu0IyQxmUj
debug: client authorized
info: handshake authorized mq0zKCgeDkisr-rbxmUk

Then it disconnects outright:

debug: setting request GET /socket.io/1/websocket/XEGx6zAP7rSWGQcaxmUB
debug: set heartbeat interval for client XEGx6zAP7rSWGQcaxmUB
debug: websocket writing 7:::1+0
warn: client not handshaken client should reconnect
info: transport end (error)
debug: set close timeout for client XEGx6zAP7rSWGQcaxmUB
debug: cleared close timeout for client XEGx6zAP7rSWGQcaxmUB
debug: cleared heartbeat interval for client XEGx6zAP7rSWGQcaxmUB
debug: discarding transport
debug: setting request GET /socket.io/1/websocket/r0Vcr7Z-r_9MnylyxmUC
debug: set heartbeat interval for client r0Vcr7Z-r_9MnylyxmUC
debug: setting request GET /socket.io/1/websocket/7RWUgoCuZPIu0IyQxmUj
debug: set heartbeat interval for client 7RWUgoCuZPIu0IyQxmUj
debug: websocket writing 7:::1+0
warn: client not handshaken client should reconnect
info: transport end (error)
debug: set close timeout for client 7RWUgoCuZPIu0IyQxmUj
debug: cleared close timeout for client 7RWUgoCuZPIu0IyQxmUj
debug: cleared heartbeat interval for client 7RWUgoCuZPIu0IyQxmUj
debug: discarding transport

And it fails to run the callback routine at all, even though it continues to act like r0Vcr7Z-r_9MnylyxmUC
is still active:

debug: cleared heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: set heartbeat interval for client r0Vcr7Z-r_9MnylyxmUC
debug: emitting heartbeat for client r0Vcr7Z-r_9MnylyxmUC
debug: websocket writing 2::
debug: set heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: got heartbeat packet
debug: cleared heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: set heartbeat interval for client r0Vcr7Z-r_9MnylyxmUC
debug: emitting heartbeat for client r0Vcr7Z-r_9MnylyxmUC
debug: websocket writing 2::
debug: set heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: got heartbeat packet
debug: cleared heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: set heartbeat interval for client r0Vcr7Z-r_9MnylyxmUC
debug: emitting heartbeat for client r0Vcr7Z-r_9MnylyxmUC
debug: websocket writing 2::
debug: set heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: got heartbeat packet
debug: cleared heartbeat timeout for client r0Vcr7Z-r_9MnylyxmUC
debug: set heartbeat interval for client r0Vcr7Z-r_9MnylyxmUC
debug: emitting heartbeat for client r0Vcr7Z-r_9MnylyxmUC

Any ideas? Thanks!

  • 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-06-17T23:52:31+00:00Added an answer on June 17, 2026 at 11:52 pm

    Since socket.io usually uses long-polling to talk to the server, each new request can be handled by any node in the cluster. Thus each node needs to have server state of the client to be able to repond to the request. The main issue is that during initial handshake socket.io needs to make few requests before creating a valid session, and they can be distributed across the cluster which adds complexity to the code. Clusterhub approach to sync everything using cross-process messaging doesn’t looks efficient to me. I would suggest looking at sticky session approach, where each client is guaranteed to work with the same node, always. You can configure load-balancer in front of your nodejs server, or try something like https://github.com/indutny/sticky-session

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

Sidebar

Related Questions

Assume I have executed this js code: var container=function() { //do something } container.a=function
I have a job that must execute each monday. This job run in a
If I run this code, will each AppDomain execute in a different thread? ThreadPool.QueueUserWorkItem(delegate
This code when executed displays the expected output but prints segmentation fault (core dumped)
I have a complex query that gets executed like this: if ($stmt = $dbi->prepare($pt_query))
This is a query that is executed without problem with MySql 5.0.51: SELECT cc_split.idSplit,
I keep getting this error when I try to commit a group of executed
This is what I have... a= document.createElement('div'); a.innerHTML=<script>alert(1)</script>; document.body.appendChild(a); The alert(1) doesnt get executed.
i came across this problem, my code in the viewWillAppear method is not executed
I have a javascript that is executed with the onchange event. onchange=showUser(1, this.value) The

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.