本文整理汇总了C++中TItem::Cat方法的典型用法代码示例。如果您正苦于以下问题:C++ TItem::Cat方法的具体用法?C++ TItem::Cat怎么用?C++ TItem::Cat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TItem
的用法示例。
在下文中一共展示了TItem::Cat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendInternal
int CUdpCast::SendInternal(const BYTE* pBuffer, int iLength)
{
int result = NO_ERROR;
if(HasStarted())
{
CCriSecLock locallock(m_csSend);
if(HasStarted())
{
ASSERT(m_iPending >= 0);
BOOL isPending = m_iPending > 0;
TItem* pItem = m_itPool.PickFreeItem();
pItem->Cat(pBuffer, iLength);
m_lsSend.PushBack(pItem);
m_iPending += iLength;
if(!isPending) m_evBuffer.Set();
}
else
result = ERROR_INVALID_STATE;
}
else
result = ERROR_INVALID_STATE;
return result;
}
示例2: CatAndPost
int CUdpServer::CatAndPost(TUdpSocketObj* pSocketObj, const BYTE* pBuffer, int iLength, BOOL isPostSend)
{
int result = NO_ERROR;
TItem* pItem = m_itPool.PickFreeItem();
pItem->Cat(pBuffer, iLength);
pSocketObj->sndBuff.PushBack(pItem);
pSocketObj->pending += iLength;
if(isPostSend && !::PostIocpSend(m_hCompletePort, pSocketObj->connID))
result = ::GetLastError();
return result;
}
示例3: Cat
int TItemList::Cat(const BYTE* pData, int length)
{
int remain = length;
while(remain > 0)
{
TItem* pItem = Back();
if(pItem == nullptr || pItem->IsFull())
pItem = PushBack(itPool.PickFreeItem());
int cat = pItem->Cat(pData, remain);
pData += cat;
remain -= cat;
}
return length;
}
示例4: Send
BOOL CUdpServer::Send(CONNID dwConnID, const BYTE* pBuffer, int iLength, int iOffset)
{
ASSERT(pBuffer && iLength > 0 && iLength <= (int)m_dwMaxDatagramSize);
if(iOffset != 0) pBuffer += iOffset;
if(!pBuffer || iLength <= 0 || iLength > (int)m_dwMaxDatagramSize)
{
::SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
int result = NO_ERROR;
TUdpSocketObj* pSocketObj = FindSocketObj(dwConnID);
if(!TUdpSocketObj::IsValid(pSocketObj))
result = ERROR_OBJECT_NOT_FOUND;
else
{
CCriSecLock locallock(pSocketObj->crisec);
if(!TUdpSocketObj::IsValid(pSocketObj))
result = ERROR_OBJECT_NOT_FOUND;
else
{
BOOL isPending = TUdpSocketObj::IsPending(pSocketObj);
TItem* pItem = m_itPool.PickFreeItem();
pItem->Cat(pBuffer, iLength);
pSocketObj->sndBuff.PushBack(pItem);
pSocketObj->pending += iLength;
if(!isPending && !::PostIocpSend(m_hCompletePort, dwConnID))
result = ::GetLastError();
}
}
if(result != NO_ERROR)
::SetLastError(result);
return (result == NO_ERROR);
}