J
J
JIakki2016-07-11 13:04:35
Node.js
JIakki, 2016-07-11 13:04:35

How to isolate events in socket.io?

For example, there is a code

io.on('connection', function(socket){
    socket.on('join', (room) => {
      console.log(room, socket.id)
    })
  });

If you connect two users, then accept one on the server, it works for two users
{ room: '12ds23sfdg234' } '/#RIbdtzB2xseyeKb8AAAA'
{ room: '12ds23sfdg234' } '/#THTZ8erZYt4RyF3kAAAB'

How can this be fixed?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-07-11
@Sanasol

Well, it's all right.
The code fulfills for each connection.
Common code for all.
What to isolate?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question