How to make permanent data updates?

There are data that are constantly updated on the server and written to the file (every 100 MS), it is necessary to carry out the transfer on the client side, yet I did it using the setInterval function (which should check them with the same interval), validating this JSON file, but how accurate are the solution of the problem, I'm not sure.
Code server part:


Client code:


In this thread I'm still green, so don't get upset if the question is simple.
June 14th 19 at 20:33
1 answer
June 14th 19 at 20:35
Look at the sockets
But if not suitable, it is better to do long polling, because the interval queries can multiply, because previous request not yet processed - therese commented on June 14th 19 at 20:38
thanks - Dimitr commented on June 14th 19 at 20:41
Socket and request-you do not need, well came, and came. And long polling is the same query again query... - Zoey.Homenick34 commented on June 14th 19 at 20:44
however, the socket requires changes on the server, not the fact that the solution is suitable - therese commented on June 14th 19 at 20:47

Find more questions by tags Node.jsJavaScript