You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that when sending binary data, it automatically sends a JSON first, and the first byte at the beginning is fixed at 04.
Online games send 60 frames of data per second, which will be very large, at least 2KB was wasted per second. Is there a way to not send that JSON automatically?
socket.on('connect', function () {
socket.emit('init',[1,2,3]);
});
io.on('connection', function (socket) {
socket.emit("foo",new Uint8Array([1,2,3]).buffer);
socket.emit("foo",new Uint8Array([1,2,3]).buffer);
});
"socket.io": "^2.2.0"
The text was updated successfully, but these errors were encountered:
I found that when sending binary data, it automatically sends a JSON first, and the first byte at the beginning is fixed at 04.
Online games send 60 frames of data per second, which will be very large, at least 2KB was wasted per second. Is there a way to not send that JSON automatically?
socket.on('connect', function () {
socket.emit('init',[1,2,3]);
});
io.on('connection', function (socket) {
socket.emit("foo",new Uint8Array([1,2,3]).buffer);
socket.emit("foo",new Uint8Array([1,2,3]).buffer);
});
"socket.io": "^2.2.0"
The text was updated successfully, but these errors were encountered: