Closed kiwi-field closed 11 months ago
@mrniko
已经解决了,前端加了3行代码。
改完以后浏览器请求应该是这样的
Seem like it's resolved and can be closed.
Hello, I repeated the mistake easily:
const len = 10
let binaryData = new ArrayBuffer(len);
let view = new Uint8Array(binaryData);
for(let i=0; i< len; i++) {
view[i] = 0;
}
socket.emit("test_binary", view)
I bypassed the problem by passing the first two bytes [0x04, 0x00].
The error message is as follows:
The front-end browser transmits parameters as shown in the following figure:
environment:
spring boot version: 2.4.8,netty-socketio version: 2.0.3, java version: 1.8,frontend socketio.js version 4.7.2 The dependent versions are as follows:
Backend code:
code :