本文整理汇总了C++中EndPoint::send方法的典型用法代码示例。如果您正苦于以下问题:C++ EndPoint::send方法的具体用法?C++ EndPoint::send怎么用?C++ EndPoint::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndPoint
的用法示例。
在下文中一共展示了EndPoint::send方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: basicSendSingleTry
//-------------------------------------------------------------------------------------
Reason NetworkInterface::basicSendSingleTry(Channel * pChannel, Packet * pPacket)
{
EndPoint * endpoint = pChannel->endpoint();
int len = endpoint->send(pPacket->data(), pPacket->totalSize());
if (len == (int)pPacket->totalSize())
{
return REASON_SUCCESS;
}
else
{
return NetworkInterface::getSendErrorReason(endpoint, len, pPacket->totalSize());
}
}
示例2: processFilterPacket
//-------------------------------------------------------------------------------------
Reason TCPPacketSender::processFilterPacket(Channel* pChannel, Packet * pPacket)
{
if(pChannel->isCondemn())
{
return REASON_CHANNEL_CONDEMN;
}
EndPoint* pEndpoint = pChannel->pEndPoint();
int len = pEndpoint->send(pPacket->data() + pPacket->sentSize, pPacket->length() - pPacket->sentSize);
if(len > 0)
{
pPacket->sentSize += len;
// DEBUG_MSG(fmt::format("TCPPacketSender::processFilterPacket: sent={}, sentTotalSize={}.\n", len, pPacket->sentSize));
}
bool sentCompleted = pPacket->sentSize == pPacket->length();
pChannel->onPacketSent(len, sentCompleted);
if (sentCompleted)
return REASON_SUCCESS;
return checkSocketErrors(pEndpoint);
}
示例3: processSendPacket
Reason TCPPacketSender::processSendPacket(Channel* pChannel, Packet* pPacket)
{
if(pChannel->isCondemn())
{
return REASON_CHANNEL_CONDEMN;
}
EndPoint* pEndPoint = pChannel->getEndPoint();
int32 len = pEndPoint->send(pPacket->data() + pPacket->m_sentSize, (int32)(pPacket->length() - pPacket->m_sentSize));
if(len > 0)
{
pPacket->m_sentSize += len;
}
bool sentCompleted = pPacket->m_sentSize == pPacket->length();
pChannel->onPacketSent(len, sentCompleted);
if(sentCompleted)
return REASON_SUCCESS;
return checkSocketErrors(pEndPoint);
}
示例4: send
//-------------------------------------------------------------------------------------
void Bundle::send(EndPoint& ep)
{
BUNDLE_SEND_OP(ep.send(pPacket->data(), pPacket->totalSize()));
}