Answer the question
In order to leave comments, you need to log in
How to organize an array of socket.io node js events?
Hello. There was such a problem. Let's say we have "very important data" that the client should receive as soon as possible. For example, if the client has a bad Internet connection and it can start missing events sent over the web socket, how to fix this situation. Or, for example, when the site is loaded, the data is loaded by the usual get request (primary) and then socket.io is immediately connected to load new information in real time. But there is a question, what if an event occurs between receiving data on the initial page load and connecting the client to socket.io, it turns out that it will not be received by the client already? How to avoid it?
Answer the question
In order to leave comments, you need to log in
For example, send the id of the last received event to the server and, after connecting via socket.io, send events with a large id.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question