|
@@ -110,7 +110,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler |
|
|
// Console.WriteLine(message); |
|
|
// Console.WriteLine(message); |
|
|
} |
|
|
} |
|
|
// 过长且不完整 |
|
|
// 过长且不完整 |
|
|
if (inputString.Length > messageLength) |
|
|
|
|
|
|
|
|
if (inputString.Length > messagesStringLength) |
|
|
{ |
|
|
{ |
|
|
var overLongbuffer = Unpooled.Buffer(); |
|
|
var overLongbuffer = Unpooled.Buffer(); |
|
|
overLongbuffer.WriteBytes(Unpooled.WrappedBuffer(Encoding.ASCII.GetBytes(inputString.Substring(messageLength, inputString.Length- messageLength)))); |
|
|
overLongbuffer.WriteBytes(Unpooled.WrappedBuffer(Encoding.ASCII.GetBytes(inputString.Substring(messageLength, inputString.Length- messageLength)))); |
|
@@ -118,7 +118,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler |
|
|
buffer = overLongbuffer; |
|
|
buffer = overLongbuffer; |
|
|
} |
|
|
} |
|
|
// 数据完整 |
|
|
// 数据完整 |
|
|
if (inputString.Length ==messageLength) |
|
|
|
|
|
|
|
|
if (inputString.Length == messagesStringLength) |
|
|
{ |
|
|
{ |
|
|
ReleaseBuffer(); |
|
|
ReleaseBuffer(); |
|
|
} |
|
|
} |
|
|