1

I can't understand what is the difference between io.emit and io.sockets.emit.

Sometimes they behave same but at other times they behave different.

1 Answers1

1

socket.emit

sends the message to sender-client only

io.emit

sendings to all clients, include sender

I got it from here: io.emit vs socket.emit

Community
  • 1
  • 1
Sahith Vibudhi
  • 4,935
  • 2
  • 32
  • 34
  • 1
    The OP asked about `io.sockets.emit` specifically. That does not seem to be addressed in this answer. – kojow7 Oct 10 '17 at 03:52