Ejemplo n.º 1
0
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());
}
Ejemplo n.º 2
0
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());
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
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;
}