• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Join room in another namespace in socket.io

I have this code bellow and it works great in socket.io version 1.3.7

this.gameInfra = io.of('/game_infra');
this.gameInfra.on('connection', (socket) => {

    socket.on('join_room', (room) => {
            var comSocket = self.chatCom.connected[socket.id];
            comSocket.room = room.name;

this.chatCom = io.of('/chat_com');
this.chatCom.on('connection', (socket) => {
    socket.on('message', (message) => {
            message.username = self.gameInfra.connected[socket.id].username;

Open in new window

I want to upgrade my socket.io to the latest version but this code
var comSocket = self.chatCom.connected[socket.id]; 

Open in new window

is undefined in newer versions.

Anyone who nows the new syntax?
roy wiliams
roy wiliams
1 Solution
Floyd jamesonCommented:
Henrik pattsonCommented:
Why do you want to upgrade your socket.io version?
roy wiliamsAuthor Commented:
The last post in the link was my solution.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now