I am using node js 4.2.6 version and using 1.4.5 socket.io version.I am using socket.io-redis module as the adaptor for socket.io. I am having two server with port 3000 and 4000. I added timer to print total number of connection sockets as below.
var socketio = require('socket.io')
var redis = require('socket.io-redis'),
io=socketio.listen(server);
io.adapter(redis({ host: '127.0.0.1', port: 6379 }));
setInterval(function() {
console.log("The total sockets are:::::::::::::", Object.keys(io.sockets.connected).length);
}, 5000 );
In one server I am getting correct client count , but in another I am getting 0.How can synchronize the socket.io clients between the server.