A
A
Artur Aralin2015-03-24 13:22:59
Node.js
Artur Aralin, 2015-03-24 13:22:59

Socket.io: How to make an event run on all connected computers except mine?

There is this code on the server:

socket.on('connect', function() {
socket.on('clientUpdate', function() {
/*сервер выполняет все нужное*/
socket.brodcast.json.emit('serverUpdate', Obj);
})
})

And how to make it work for all connected to the server, except for the machine from which the clientUpdate handler was called ?
upd:
An event on each machine is executed in one emit exactly as many times as there are connected clients

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Shemsedinov, 2015-03-24
@MarcusAurelius

I don't use socket.io, but if you're already invited to reply, try socket.broadcast.emit('eventName', data);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question