Skip to content

Commit 59a8120

Browse files
committed
[修复]1. 修复如果收到空消息的时候,需要收到其他消息的时候才会触发解析的BUG
1 parent e80a3b6 commit 59a8120

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Runtime/Network/Network/SystemSocket/NetworkManager.SystemTcpNetworkChannel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void ReceiveCallback(IAsyncResult asyncResult)
123123
throw;
124124
}
125125

126-
if (bytesReceived <= 0 && !PReceiveState.IsEmptyBody)
126+
if (bytesReceived <= 0)
127127
{
128128
Close();
129129
return;
@@ -150,6 +150,13 @@ private void ReceiveCallback(IAsyncResult asyncResult)
150150
else
151151
{
152152
processSuccess = ProcessPackHeader();
153+
if (PReceiveState.IsEmptyBody)
154+
{
155+
// 如果是空消息,直接返回
156+
ProcessPackBody();
157+
ReceiveAsync();
158+
return;
159+
}
153160
}
154161

155162
if (processSuccess)

0 commit comments

Comments
 (0)