B
B
Banan442020-05-26 23:06:22
Socket.io
Banan44, 2020-05-26 23:06:22

What is the difference between io.to and io.in?

What is the difference between io.to('room') and io.in('room') in both cases, sending goes to all addresses in the room (including the sender). Only in is not present in the socket object

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2020-05-26
@Banan44

well, apparently in the dock socket.io lies.
Because for the Socket object in/to are identical
And for the server there are no separate implementations of these methods at all, if I understand correctly that io.to/in and other methods are directly thrown into the main channel, /i.e. again a Socket object.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question