Answer the question
In order to leave comments, you need to log in
Is it possible to send an event to the room immediately after adding the socket?
I add a socket to the room
After I send an event
Sockets that have already been in the room receive a message, but the one that joined just like this:
client.join('markets');
client.to('markets').emit('getData', data);
socket.on('connect', function() {
socket.emit('getNewData', null, (data) => { console.log({ data }) });
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question