code review: Transport

This commit is contained in:
ghy
2021-04-22 10:57:24 +08:00
parent 1894d7056c
commit d213bda096
+4 -1
View File
@@ -1,5 +1,6 @@
package logicface;
import common.LoggerHelper;
import encoding.*;
import packet.LpPacket;
import packet.PacketException;
@@ -33,11 +34,13 @@ public class Transport {
public LpPacket parseByteArray2LpPacket(byte[] buf) throws LogicFaceException {
try {
Block block=new Block(buf,true);
if(block.isValid()){
if(!block.isValid()){
LoggerHelper.logger.error("recv packet from face invalid");
return null;
}
LpPacket lpPacket=new LpPacket();
if(!lpPacket.wireDecode(block)){
LoggerHelper.logger.error("parse to lpPacket error");
return null;
}
return lpPacket;