使用微信小程序进行websocket连接,在电脑端微信开发工具上本地测试连接与数据传输正常,但是使用手机真机调试时,连接正常,发送的数据会报类型转换错误
具体报错如下:
[iohao.com:external-netty-server-worker-7] ERROR ExternalTopic - class io.netty.handler.codec.http.websocketx.TextWebSocketFrame cannot be cast to class com.iohao.game.external.core.message.ExternalMessage (io.netty.handler.codec.http.websocketx.TextWebSocketFrame and com.iohao.game.external.core.message.ExternalMessage are in unnamed module of loader 'app')
java.lang.ClassCastException: class io.netty.handler.codec.http.websocketx.TextWebSocketFrame cannot be cast to class com.iohao.game.external.core.message.ExternalMessage (io.netty.handler.codec.http.websocketx.TextWebSocketFrame and com.iohao.game.external.core.message.ExternalMessage are in unnamed module of loader 'app')
at com.iohao.game.external.core.netty.handler.SocketIdleHandler.channelRead(SocketIdleHandler.java:55)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.
使用微信小程序进行websocket连接,在电脑端微信开发工具上本地测试连接与数据传输正常,但是使用手机真机调试时,连接正常,发送的数据会报类型转换错误 具体报错如下: [iohao.com:external-netty-server-worker-7] ERROR ExternalTopic - class io.netty.handler.codec.http.websocketx.TextWebSocketFrame cannot be cast to class com.iohao.game.external.core.message.ExternalMessage (io.netty.handler.codec.http.websocketx.TextWebSocketFrame and com.iohao.game.external.core.message.ExternalMessage are in unnamed module of loader 'app') java.lang.ClassCastException: class io.netty.handler.codec.http.websocketx.TextWebSocketFrame cannot be cast to class com.iohao.game.external.core.message.ExternalMessage (io.netty.handler.codec.http.websocketx.TextWebSocketFrame and com.iohao.game.external.core.message.ExternalMessage are in unnamed module of loader 'app') at com.iohao.game.external.core.netty.handler.SocketIdleHandler.channelRead(SocketIdleHandler.java:55) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.