Answer the question
In order to leave comments, you need to log in
How to kill socket.emit?
Good afternoon, there
socket.on('songchanged', function(changed){
setInterval(function(){
socket.broadcast.emit('changed', changed);
}, 3000);
});
Answer the question
In order to leave comments, you need to log in
Why are you creating a question and not listening to the answers?
Why in the event system, do broadcast via Interval?
Why Interval and not setTimeout ?
Why are you even using Nodejs if you clearly don't understand it?
io.on('connection', function (socket) {
socket.on('songchanged', function(changed){
socket.broadcast.emit('changed', data);
})
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question