From 45e13cef87368c22ab931279c341e001862cd9c5 Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 1 Mar 2024 17:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=B2=98=E5=8C=85=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TcpServer/Handler/ProtocolHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NearCardAttendance.Service/TcpServer/Handler/ProtocolHandler.cs b/NearCardAttendance.Service/TcpServer/Handler/ProtocolHandler.cs index a0ddfe9..04db362 100644 --- a/NearCardAttendance.Service/TcpServer/Handler/ProtocolHandler.cs +++ b/NearCardAttendance.Service/TcpServer/Handler/ProtocolHandler.cs @@ -110,7 +110,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler // Console.WriteLine(message); } // 过长且不完整 - if (inputString.Length > messageLength) + if (inputString.Length > messagesStringLength) { var overLongbuffer = Unpooled.Buffer(); overLongbuffer.WriteBytes(Unpooled.WrappedBuffer(Encoding.ASCII.GetBytes(inputString.Substring(messageLength, inputString.Length- messageLength)))); @@ -118,7 +118,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler buffer = overLongbuffer; } // 数据完整 - if (inputString.Length ==messageLength) + if (inputString.Length == messagesStringLength) { ReleaseBuffer(); }