user7197564
user7197564

Reputation:

What is the difference between io.emit and io.sockets.emit?

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.

Upvotes: 1

Views: 1096

Answers (1)

Sahith Vibudhi
Sahith Vibudhi

Reputation: 5225

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

Upvotes: 1

Related Questions