V
V
Vladimir Golub2022-01-13 12:57:29
Socket.io
Vladimir Golub, 2022-01-13 12:57:29

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 }) });
      });


Can it be added directly to the audition?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question