I want to sent data to one specific socket ID.
We used to be able to do this in the older versions:
io.sockets.socket(socketid).emit(\'message\', \'
I believe both @Curious and @MustafaDokumacı provided solutions that work well. The difference though is that with @MustafaDokumacı's solution the message is broadcasted to a room and not only to a particular client.
The difference is prominent when an acknowledgement is requested.
io.sockets.connected[socketid].emit('message', 'for your eyes only', function(data) {...});
works as expected, while
io.to(socketid).emit('message', 'for your eyes only', function(data) {...});
fails with
Error: Callbacks are not supported when broadcasting