I am trying to make a logged in user to join a certain socket.io room on connect. According to any examples I found on the net I seem to have emit some action from client to be
There is no .join()
method on the client side. Rooms are purely a server-side construct and the client knows nothing about them.
Your first block of code is the desired way to do things. You send the server a message of your design asking it to join the socket to a room and the .join()
is executed on the server side.