EnHandleResult CTcpPullServer::FireReceive(TSocketObj* pSocketObj, const BYTE* pData, int iLength) { TBuffer* pBuffer = m_bfPool[pSocketObj->connID]; ASSERT(pBuffer && pBuffer->IsValid()); pBuffer->Cat(pData, iLength); return __super::FireReceive(pSocketObj, pBuffer->Length()); }
EnHandleResult CTcpPullAgent::FireReceive(TSocketObj* pSocketObj, const BYTE* pData, int iLength) { TBuffer* pBuffer = nullptr; GetConnectionReserved(pSocketObj, (PVOID*)&pBuffer); ASSERT(pBuffer && pBuffer->IsValid()); pBuffer->Cat(pData, iLength); return __super::FireReceive(pSocketObj, pBuffer->Length()); }
EnHandleResult CTcpPullAgent::FireReceive(TSocketObj* pSocketObj, const BYTE* pData, int iLength) { TBuffer* pBuffer = m_bfPool[pSocketObj->connID]; if(pBuffer != nullptr && pBuffer->IsValid()) { int len = 0; { CCriSecLock locallock(pBuffer->CriSec()); if(pBuffer->IsValid()) { pBuffer->Cat(pData, iLength); len = pBuffer->Length(); } } if(len > 0) return __super::FireReceive(pSocketObj, len); } return HR_IGNORE; }
ISocketListener::EnHandleResult CTcpPullServer::FireReceive(CONNID dwConnID, const BYTE* pData, int iLength) { TBuffer* pBuffer = m_bfPool[dwConnID]; if(pBuffer != nullptr && pBuffer->IsValid()) { int len = 0; { CCriSecLock locallock(pBuffer->CriSec()); if(pBuffer->IsValid()) { pBuffer->Cat(pData, iLength); len = pBuffer->Length(); } } if(len > 0) return __super::FireReceive(dwConnID, len); } return ISocketListener::HR_IGNORE; }