N
N
nezzard2016-12-21 19:19:13
Socket.io
nezzard, 2016-12-21 19:19:13

How to output values ​​from socket.io?

Hello, do you have a code?

socket.emit('sendData', data);

socket.on('sendData', function(data){ обработка })


I need to get the processing value from socket.on, but only when socket.emit('getData');

The logic is that there is a server on which there is a playlist, there is a main server and there is a client.
I need a
Playlist (Send to the socket server) - Server (processes data and waits for emit getData) - the client loads the page and emit('getData') occurs, after which the server should give values ​​from socket.on('sendData',)

The problem is that I need to get it at the same second, without waiting for socket.on('sendData') to restart the server with playlists

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