diff --git a/ProjectNLD/Assets/Code/Scripts/Framework/Net/NetTcp.cs b/ProjectNLD/Assets/Code/Scripts/Framework/Net/NetTcp.cs index 98d5d9e6239..4e62af53405 100644 --- a/ProjectNLD/Assets/Code/Scripts/Framework/Net/NetTcp.cs +++ b/ProjectNLD/Assets/Code/Scripts/Framework/Net/NetTcp.cs @@ -376,7 +376,16 @@ namespace Framework try { int nReceiveLength = m_Socket.EndReceive(iar); - OnReceiveData(nReceiveLength); + if(nReceiveLength > 0) + { + OnReceiveData(nReceiveLength); + Receive(); + } + else + { + Close(); + PushEventError(NetError.Recv); + } } catch (SocketException e) { @@ -399,7 +408,7 @@ namespace Framework return; } - Receive(); + } private int GetPackageLength(byte[] buffer,