I have a problem when using socket.emit from Nodejs because all the Android users are getting the message instead of the one that starts the conversation. Let me explain:
From android I have that code run by a user when he create a new post
socket.emit('post.new', data);
At the Node.js I have
socket.on('post.new', function (data) {
var post = new Post(data);
post.save();
socket.emit('post.new.ack', post);
socket.broadcast.emit('post.create', post);
});
The snippet socket.emit('post.new.ack', post)
is supposed to be received only by the Android user who send post.new event but all the android users get that even. Why ?
Is there something I'm doing wrong ?