From 9b3f131849e26632c27bcace4041fcd623492371 Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Tue, 29 Jan 2019 17:41:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/jtne_tcp.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/jtne_tcp.md b/doc/jtne_tcp.md index 5017299..47cb32e 100644 --- a/doc/jtne_tcp.md +++ b/doc/jtne_tcp.md @@ -5,10 +5,15 @@ 参数说明: maxFrameLength:解码的帧的最大长度 + lengthFieldOffset:长度字段的偏差(长度属性的起始位(偏移位),包中存放有整个大数据包长度的字节,这段字节的其实位置) + lengthFieldLength:长度字段占的字节数(即存放整个大数据包长度的字节所占的长度) + lengthAdjustmen:添加到长度字段的补偿值(长度调节值,在总长被定义为包含包头长度时,修正信息长度)。 + initialBytesToStrip:从解码帧中第一次去除的字节数(跳过的字节数,根据需要我们跳过lengthFieldLength个字节,以便接收端直接接受到不含“长度属性”的内容) + failFast :为true,当frame长度超过maxFrameLength时立即报TooLongFrameException异常,为false,读取完整个帧再报异常 ### JTNE协议处理 @@ -77,4 +82,4 @@ channel.Pipeline.AddLast("jtneTcpDecoder", new LengthFieldBasedFrameDecoder(int. ![tcp_test2](https://github.com/SmallChi/JTNewEnergyDotNetty/blob/master/doc/img/tcp_test2.png) -5.解决了服务端协议的解码问题对于上层业务处理来说就是搬砖的是了 \ No newline at end of file +5.解决了服务端协议的解码问题对于上层业务处理来说就是搬砖的是了