if I emit from serverside it is imperative that the code can only respond with "on" at clientside?
My Problem is that if a user login he gets a specific users list as object.
Imagine A logs in, this gets a custom object with the contents of user B, G and X. Now is the problem, that the users B, G and X are each also have a custom object. Of course, everything on the server side.
Now I tried just a server side emit to send to these users. This emitted should also be received on the server side with an on. However, it does not work.
I tried something like this
io.sockets.on('connection', function(socket){
socket.on('login', function(){
for(var key in specific_object){
specific_object[key].emit('add user');
}
});
socket.on('add user', function(data){
console.log("now please....");
});
});
hopefully someone can help me :)
UPDATE
.jpg)