mrniko / netty-socketio

Socket.IO server implemented on Java. Realtime java framework
Apache License 2.0
6.77k stars 1.65k forks source link

Polling does not support chinese character #434

Open xiukongtiao opened 7 years ago

xiukongtiao commented 7 years ago

Hi, When I run your demo on IE7 after I upgrade the netty-socketio version from 1.7.7 to 1.7.12. I found if I send a English string like 'abc', it works good on IE7 But if I send a chinese word like '你好', it works good on Chrom, bu for IE6-8 there will be a exception: [nioEventLoopGroup-3-8] ERROR com.corundumstudio.socketio.handler.InPacketHandler - Error during data processing. Client sessionId: 7610ac17-00dc-4d4e-848a-7da0bac5e3f1, data: :42["chatevent",{"userName":"user452","message":"你好"}] java.lang.IllegalStateException at com.corundumstudio.socketio.protocol.UTF8CharsScanner.getActualLength(UTF8CharsScanner.java:108) at com.corundumstudio.socketio.protocol.PacketDecoder.decodePackets(PacketDecoder.java:137) at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:65) at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:36) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)

And I have checked the code, I foud this change looks like the reason, can you help me to fonfirm it, thanks a alot!

utf8pollingissuw

devpage commented 7 years ago

@xiukongtiao IE7 下 你用的哪个websocket库

swit1983 commented 6 years ago

@devpage 我这边是服务端版本1.7.12 客户端用的socket.io-client-swift v9 会出现这个异常。js客户不会