@@ -23,7 +23,10 @@ public class TcpHandle implements ServerAioHandler {
}
@Override
+ //解包
public Packet decode(ByteBuffer byteBuffer, int i, int i1, int i2, ChannelContext channelContext) throws AioDecodeException {
+ //在这里 可以拿到一个完整的 数据
+
switch (this.getName()) {
case "NHH":
return NhhJpHandle.nhhJpDecode(byteBuffer, i, i1, i2, channelContext);
@@ -95,7 +95,7 @@ public class JqSdSjHandle {
DefPacket defPackage = new DefPacket();
byte[] result = new byte[array.length];
int len = 0;
- int end = -1;
+ int end = -1; //结束位
for (int j = 0; j < array.length; j++) {
if (array[j] != 0x0A) {
len += 1;