I am trying to have various rooms following the socket.io docs, but I cannot get the client to receive the broadcasted return. I've tried with .forward() and just Socket.on(). Here is the Socket.on() example of a user joining a room, the server broadcasts the number of clients attached to the room, but the client never hears the response:
// server
socket.on('publish.join_room', function (data) {
socket.join(data.roomName);
var room = io.sockets.adapter.rooms[data.roomName];
var clientsCount = Object.keys(room).length;
socket.in(data.roomName).emit('broadcast.join_room', clientsCount)
})
I am trying to have various rooms following the socket.io docs, but I cannot get the client to receive the broadcasted return. I've tried with .forward() and just Socket.on(). Here is the Socket.on() example of a user joining a room, the server broadcasts the number of clients attached to the room, but the client never hears the response: