M
M
mozart13372016-06-17 02:25:32
Socket.io
mozart1337, 2016-06-17 02:25:32

How to transfer critical data via websocket?

Situation: when the page is loaded, quite a lot of information is loaded by ajax to fill the page, and after loading, the information is connected to update the content. Very small data (only changes) are transmitted via web sockets, which javascript already compares with its own data and inserts into html.
How to make it so that if an event occurs during the connection to websockets, then somehow get it?
How, despite network problems, to receive valid information from the server (!!! DATA SEQUENCE IS IMPORTANT !!)?
How to implement all this so as not to miss more than one event, but also transfer little data via web sockets (not the entire array, but only changes)? Mb there are some libraries?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2016-06-17
@Taraflex

Resend timestamp with each data packet.
When connecting / reconnecting, send the last received label.
The server sends the data changed since the last label.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question