尽量上传

This commit is contained in:
nnhy 2015-11-27 10:52:53 +00:00
parent b221535a96
commit dd62abf110
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,9 @@ void PingMessage::WriteData(Stream& ms, byte code, const Array& bs)
TS("PingMessage::WriteData");
byte len = bs.Length() - 1;
if(ms.Position() + 3 + len > MaxSize) return;
//if(ms.Position() + 3 + len > MaxSize) return;
byte remain = MaxSize - ms.Position() - 3;
if(len > remain) len = remain;
ms.Write(code); // 子功能码
ms.Write((byte)0x01); // 起始地址