netty-socketio icon indicating copy to clipboard operation
netty-socketio copied to clipboard

netty-socketio 2.0.3 是不是不支持socket.io-client 3.0+

Open qq1031824970 opened this issue 2 years ago • 7 comments

我看到好像支持了socket.io-client4。但是使用时发现用socket.io-client3.0+版本发送二进制数据时后端会出现解码错误,错误如下: image image 二进制传输是还没有适配吗

qq1031824970 avatar Oct 12 '23 13:10 qq1031824970

使用2.5.0版本可以正常传输,这好像也是官方demo中使用的js版本

qq1031824970 avatar Oct 12 '23 13:10 qq1031824970

image netty-socketio 2.0.3 socket.io server version maybe 2.x

qq1031824970 avatar Oct 13 '23 03:10 qq1031824970

netty-socketio demo is out of date

mrniko avatar Oct 13 '23 06:10 mrniko

兄弟解决了吗,2+版本前端js版本用多少啊

orzming avatar Oct 31 '23 09:10 orzming

兄弟解决了吗,2+版本前端js版本用多少啊

建议别用2+的版本,前端流浪器放到非活动页就经常掉线 我现在用的就是后端是这边的最新版本,前端用的2.2版本,听说4版本解决了这个问题不知道真假

kyan54 avatar Nov 07 '23 14:11 kyan54

The current test results indicate that V3/V4 cannot be supported.

The Swift version, need to force setting V2 option. When the Java client version connect, it triggers the server's addConnectListener twice. The Dart client version 2.x cannot connect and needs to downgrade to 1.x. For the other unmentioned languages, when sending binary data, an extra byte (value is 4) will be added at the beginning.


目前测试下来是无法正常支持V3和V4的client端。

Swift Client端需要强制设置V2 Java Client端连接时会触发两次服务端的addConnectListener Dart Client端2.x版本无法连接,需要降级1.x 在可以连接的client端,二进制会多首位多增加一位byte(值是4)

xuhaoyang avatar Jan 30 '24 02:01 xuhaoyang

I have discovered two issues when using nettysocketio 2.0.8 with EIOv4 ([email protected]) which does not support binary. 1.When sending binary data using V4, it does not prepend a byte with the value 4 (indicating binary data). However, nettysocketio processes by checking the first bit for this identifier. Therefore, before sending, the identifier needs to be added. 2. When receiving binary data using V4, nettysocketio adds a byte with the identifier 4 at the very beginning of the binary data. 00000000: 040a 1531 4852 7841 314f 5950 566e 5137 ...1HRxA1OYPVnQ7 00000001: 3376 674c 4970 7652 108b c8f6 8dd7 311a 3vgLIpvR......1. 00000002: 170a 0a31 3030 3031 3130 3030 3112 09e5 ...1000110001... 00000003: a4a7 e790 86e7 9fb3 ........

In conclusion, when using nettysocketio 2.0.8 in combination with EIOv4 to send and receive binary data, it is necessary to manually handle the identification bit of the binary data.

bulinbulinxmz avatar Feb 04 '24 01:02 bulinbulinxmz