we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "io emit vs socket emit"
Kinley
04 Oct 2019
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')
Henri
31 Feb 2016
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