Answer the question
In order to leave comments, you need to log in
How to optimize transmitted traffic through socket.io?
I am writing a Node.Js client-server game, during the game there is an exchange of a large amount of information about objects with their coordinates.
I wondered what would reduce traffic, please tell me which implementation will eat less traffic and how much less?
obj = {
x: 1472,
y: 1963,
radius: 10,
border: 3,
filled: 0,
different: 4,
mass: 1,
hue: 192,
sides: 6
}
socket.emit(obj)
var obj = new Float32Array([1472,1963,10,3,0,4,1,192,6]).buffer;
socket.emit(obj)
Answer the question
In order to leave comments, you need to log in
If deflate is used, there is no point in pressing it.
You can play around with JSZip, but this will create additional overhead.
If you want to create an efficient protocol, it's better to use protobuf .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question