add LengthFieldBasedFrameDecoder
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -92,7 +92,7 @@ public abstract class AbstractClient implements Client {
|
||||
logger.debug("write {} to channel", sdkProto);
|
||||
|
||||
byte[] bytes = NettyUtil.toBytes(sdkProto);
|
||||
MyProtocolBean myProtocolBean = new MyProtocolBean((byte)0xA, (byte)0xC, bytes.length, bytes);
|
||||
MyProtocolBean myProtocolBean = new MyProtocolBean((byte) 0xA, (byte) 0xC, bytes.length, bytes);
|
||||
channel.writeAndFlush(myProtocolBean).addListener((ChannelFutureListener) channelFuture -> {
|
||||
if (channelFuture.isSuccess()) {
|
||||
//发送成功后立即跳出
|
||||
@@ -138,7 +138,7 @@ public abstract class AbstractClient implements Client {
|
||||
logger.debug("write {} to channel", sdkProto);
|
||||
|
||||
byte[] bytes = NettyUtil.toBytes(sdkProto);
|
||||
MyProtocolBean myProtocolBean = new MyProtocolBean((byte)0xA, (byte)0xC, bytes.length, bytes);
|
||||
MyProtocolBean myProtocolBean = new MyProtocolBean((byte) 0xA, (byte) 0xC, bytes.length, bytes);
|
||||
channelFuture.channel().writeAndFlush(myProtocolBean).addListener(channelFuture -> {
|
||||
if (channelFuture.isSuccess()) {
|
||||
return;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package io.github.ehlxr.did.client;
|
||||
|
||||
import io.github.ehlxr.did.netty.MyProtocolDecoder;
|
||||
import io.github.ehlxr.did.netty.MyProtocolEncoder;
|
||||
import io.github.ehlxr.did.client.handler.SdkClientHandler;
|
||||
import io.github.ehlxr.did.common.Constants;
|
||||
import io.github.ehlxr.did.common.Try;
|
||||
import io.github.ehlxr.did.netty.MyProtocolDecoder;
|
||||
import io.github.ehlxr.did.netty.MyProtocolEncoder;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.socket.SocketChannel;
|
||||
|
Reference in New Issue
Block a user