diff --git a/CommService/LOG.rar b/CommService/LOG.rar new file mode 100644 index 0000000..618c9d0 Binary files /dev/null and b/CommService/LOG.rar differ diff --git a/CommService/TCPHandler.cs b/CommService/TCPHandler.cs index e453dd2..3a3e683 100644 --- a/CommService/TCPHandler.cs +++ b/CommService/TCPHandler.cs @@ -104,6 +104,10 @@ namespace CommService while (i != 0) { + if (!IPAddress.Parse(((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString()).ToString().Contains("112.224")) + { + break; + } byte[] rcvbytes = new byte[i]; for (int j = 0; j < i; j++) { @@ -125,16 +129,16 @@ namespace CommService rcvBuff = tmp; //数据包识别 - //byte[] pack = UPPHandler.FindPackFromBuff(ref rcvBuff); - byte[] pack = new byte[rcvBuff.Length]; - Array.Copy(rcvBuff,0,pack,0, rcvBuff.Length); + byte[] pack = UPPHandler.FindPackFromBuff(ref rcvBuff); + //byte[] pack = new byte[rcvBuff.Length]; + //Array.Copy(rcvBuff,0,pack,0, rcvBuff.Length); if (this.tName == "未知终端" && pack.Length == 0) { break; } - while (rcvBuff.Length > 0) + while (pack.Length > 0) { Common.logFile.writeHexString("[" + this.tName + "] " + "收到帧: ", pack, LogFile.LOGLVL_DEBUG);