mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
code review: Transport
This commit is contained in:
1 parent
1894d7056c
commit
d213bda096
1 file changed
+4
-1
@@ -1,5 +1,6 @@
|
|||||||
package logicface;
|
package logicface;
|
||||||
|
|
||||||
|
import common.LoggerHelper;
|
||||||
import encoding.*;
|
import encoding.*;
|
||||||
import packet.LpPacket;
|
import packet.LpPacket;
|
||||||
import packet.PacketException;
|
import packet.PacketException;
|
||||||
@@ -33,11 +34,13 @@ public class Transport {
|
|||||||
public LpPacket parseByteArray2LpPacket(byte[] buf) throws LogicFaceException {
|
public LpPacket parseByteArray2LpPacket(byte[] buf) throws LogicFaceException {
|
||||||
try {
|
try {
|
||||||
Block block=new Block(buf,true);
|
Block block=new Block(buf,true);
|
||||||
if(block.isValid()){
|
if(!block.isValid()){
|
||||||
|
LoggerHelper.logger.error("recv packet from face invalid");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LpPacket lpPacket=new LpPacket();
|
LpPacket lpPacket=new LpPacket();
|
||||||
if(!lpPacket.wireDecode(block)){
|
if(!lpPacket.wireDecode(block)){
|
||||||
|
LoggerHelper.logger.error("parse to lpPacket error");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return lpPacket;
|
return lpPacket;
|
||||||
|
|||||||
Reference in new issue
Block a user