本文整理汇总了C++中TBuffer::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuffer::IsValid方法的具体用法?C++ TBuffer::IsValid怎么用?C++ TBuffer::IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuffer
的用法示例。
在下文中一共展示了TBuffer::IsValid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Fetch
EnFetchResult CTcpPullAgent::Fetch(CONNID dwConnID, BYTE* pData, int iLength)
{
ASSERT(pData != nullptr && iLength > 0);
EnFetchResult result = FR_DATA_NOT_FOUND;
TBuffer* pBuffer = m_bfPool[dwConnID];
if(pBuffer != nullptr && pBuffer->IsValid())
{
CCriSecLock locallock(pBuffer->CriSec());
if(pBuffer->IsValid())
{
if(pBuffer->Length() >= iLength)
{
pBuffer->Fetch(pData, iLength);
result = FR_OK;
}
else
result = FR_LENGTH_TOO_LONG;
}
}
return result;
}
示例2: FireReceive
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());
}
示例3: FireReceive
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());
}
示例4: FireReceive
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;
}
示例5: FireReceive
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;
}