socket.io emit inside function code example
Example: 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
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