I'm starting to work with Socket.io on Node.js, the question for now is simple. Using my example below. What's the difference in using socket.emit () and chat.emit ()? PS: * I hope you have no kkk syntax error.
var chat = io.of('/chat')
.on('connection', function (socket) {
socket.emit('testOne', {
data: 'data'
});
chat.emit('testTwo', {
data2: 'data2'
});
});