Monday, 15 May 2017

socket io group emit is not working when running on nodejs cluster

i had made an chat application in which i am emitting to gorup using

 var io = require('socket.io')(/*passing https server here*/);
 var redis =require('socket.io-redis');
 io.adapter(redis({/*redis server host port*/}));
 function emitToGroup(groupId){
   io.sockets.in(groupId).emit("channel", data);
 }

i am running in an Ubuntu server(14.04) machine with nodejs(6.10.x) clustered environment, the problem lies is that emit to group is working fine when clustered mode is off but on switching on the clustered mode its not working, one more peculiar thing is that clustered mode is working when running on windows machine , please help me with the issue ,that what is going wrong in there



via Pranay Dutta

No comments:

Post a Comment