What’s the Difference Between socket.emit() and server.emit(). #5425
-
|
Hello! I’m wondering what the difference is between socket.emit() and server.emit() in Socket.IO. I know that socket.broadcast.emit() sends a message to all clients except the one that triggered the event, but I’m not completely sure how socket.emit() and server.emit() differ in practice? |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Dec 11, 2025
Replies: 1 comment
-
|
Hi! References: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Bubuioc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
socket.emit()will emit to one single client, whereasserver.emit()will emit to all connected clients.References: