socket.io
socket.io copied to clipboard
Join room doesnt work for namespaced clients Socket.io 1.3.6
The following example works fine if no namespace or namespace is set to '/'. If you set namespace like '/mynamepsace'. Won't work. socket.join('test room'); console.log(io.sockets.adapter.rooms);
Closing this issue as it is due to the undocumented bad convention rather than coding bug. Rooms added from within namespace is not available in the global namespace, and also its access convention is different. Works as below: Global: io.sockets.adapter.rooms Namespaced: io.of('/yournamespace').adapter.rooms Note: sockets part is omitted in the namespaced version. io.of('/yournamespace').sockets.adapter.rooms won't work, neither will io.adapter.rooms.