netty-socketio
netty-socketio copied to clipboard
if ack returns after the timeout trigger ,a IllegalStateException will be thrown
version:2.0.9
- onTimeout() will remove ackCallback,however ackCallback is necessary while package decoding.
file:com/corundumstudio/socketio/ack/AckManager.java line:157
file:com/corundumstudio/socketio/protocol/PacketDecoder.java line:300
- if callback is null, the byteBuf will not be read. And the the loop will run second time!
file:com/corundumstudio/socketio/handler/InPacketHandler.java line:64
- however the data in the buffer is already wrong, so it cannot get the right type, and then throw the IllegalStateException
file:com/corundumstudio/socketio/protocol/PacketType.java line:42
if (callback != null) { ByteBufInputStream in = new ByteBufInputStream(frame); AckArgs args = jsonSupport.readAckArgs(in, callback); packet.setData(args.getArgs()); }else { frame.clear(); } what if I write it like this? @mrniko #965
this is test result ,nothing exception
@malinGH
What about the case then there are other packets next to this packet? they won't be parsed if bytebuf readIndex reset to zero
It's better to use the code below.
frame.skipBytes(frame.readableBytes());
Now the buffer was consumed completely.
let me try
@mrniko Test is fail, You need to test this version, branch:master