修改netty版本websocket刷新页面导致后台出现java.lang.IndexOutOfBoundsException异常的问题

This commit is contained in:
远方夕阳 2018-12-28 10:38:08 +08:00
parent e8a7947838
commit 0067844a7c
5 changed files with 17 additions and 8 deletions

View File

@ -15,6 +15,11 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>

View File

@ -0,0 +1,2 @@
boot.validation.initialized=true
eclipse.preferences.version=1

View File

@ -50,12 +50,12 @@ dependencies {
compile 'com.squareup.okhttp3:okhttp:3.10.0' compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'cn.teaey.apns4j:apns4j:1.1.4' compile 'cn.teaey.apns4j:apns4j:1.1.4'
compile 'io.netty:netty-handler:4.1.28.Final' compile 'io.netty:netty-handler:4.1.32.Final'
compile 'io.netty:netty-buffer:4.1.28.Final' compile 'io.netty:netty-buffer:4.1.32.Final'
compile 'io.netty:netty-codec:4.1.28.Final' compile 'io.netty:netty-codec:4.1.32.Final'
compile 'io.netty:netty-codec-http:4.1.28.Final' compile 'io.netty:netty-codec-http:4.1.32.Final'
compile 'io.netty:netty-common:4.1.28.Final' compile 'io.netty:netty-common:4.1.32.Final'
compile 'io.netty:netty-transport:4.1.28.Final' compile 'io.netty:netty-transport:4.1.32.Final'

View File

@ -21,6 +21,7 @@
*/ */
package com.farsunset.cim.sdk.server.filter.decoder; package com.farsunset.cim.sdk.server.filter.decoder;
import java.nio.charset.Charset;
import java.util.List; import java.util.List;
import com.farsunset.cim.sdk.server.constant.CIMConstant; import com.farsunset.cim.sdk.server.constant.CIMConstant;
@ -103,7 +104,7 @@ public class WebMessageDecoder extends ByteToMessageDecoder {
} }
} else if (OPCODE_CLOSE == frameOqcode) { } else if (OPCODE_CLOSE == frameOqcode) {
handleClose(arg0); handleSocketClosed(arg0,iobuffer);
} else { } else {
// 忽略其他类型的消息 // 忽略其他类型的消息
iobuffer.readBytes(new byte[iobuffer.readableBytes()]); iobuffer.readBytes(new byte[iobuffer.readableBytes()]);
@ -111,7 +112,8 @@ public class WebMessageDecoder extends ByteToMessageDecoder {
} }
private void handleClose(ChannelHandlerContext arg0) { private void handleSocketClosed(ChannelHandlerContext arg0,ByteBuf iobuffer) {
iobuffer.readBytes(new byte[iobuffer.readableBytes()]);
arg0.channel().close(); arg0.channel().close();
} }