showing results for - "socket io socket emit vs send"
Sara Sofía
20 Apr 2016
1// allows you to emit custom events on the server and client
2socket.emit('my event', 'my data')
3
4// sends messages which are received with the 'message' event
5socket.send('my message')
Ilana
15 Apr 2019
1socket.emit('message', "this is a test"); //sending to sender-client only
2io.emit('message', "this is a test"); //sending to all clients, include sender