|
@@ -815,6 +815,15 @@ void CIOCPModel::_RecvProcess(PER_SOCKET_CONTEXT* pSocketContext, PER_IO_CONTEXT
|
|
|
if ( phead->len <= pSocketContext->lastData.size() )
|
|
|
{
|
|
|
OutputDebugString("C:超包;\n");
|
|
|
+ // 完整包;
|
|
|
+ _DeviceProc(pIoContext, (Package*)pSocketContext->lastData.substr(0, phead->len).data());
|
|
|
+
|
|
|
+ pSocketContext->lastData = pSocketContext->lastData.substr(phead->len);
|
|
|
+ pSocketContext->lastData.append(pIoContext->m_wsaBuf.buf, pIoContext->m_Overlapped.InternalHigh);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OutputDebugString("D:超包;\n");
|
|
|
lastlen = pSocketContext->lastData.size() + pIoContext->m_Overlapped.InternalHigh - phead->len;
|
|
|
pSocketContext->lastData.append(pIoContext->m_wsaBuf.buf, pIoContext->m_Overlapped.InternalHigh - lastlen);
|
|
|
// 完整包;
|
|
@@ -824,10 +833,6 @@ void CIOCPModel::_RecvProcess(PER_SOCKET_CONTEXT* pSocketContext, PER_IO_CONTEXT
|
|
|
if (lastlen)
|
|
|
pSocketContext->lastData.append(pIoContext->m_wsaBuf.buf + pIoContext->m_Overlapped.InternalHigh - lastlen, lastlen);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
{
|