Answers for "socket io socket emit vs send"

0

socket io socket emit vs send

// allows you to emit custom events on the server and client
socket.emit('my event', 'my data')

// sends messages which are received with the 'message' event
socket.send('my message')
Posted by: Guest on May-08-2021
0

io.emit vs socket.emit

socket.emit('message', "this is a test"); //sending to sender-client only
io.emit('message', "this is a test"); //sending to all clients, include sender
Posted by: Guest on September-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language