当前位置: 首页>>代码示例>>C++>>正文


C++ EndPoint::send方法代码示例

本文整理汇总了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());
	}
}
开发者ID:sdsgwangpeng,项目名称:kbengine,代码行数:15,代码来源:network_interface.cpp

示例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);
}
开发者ID:Eayon,项目名称:kbengine,代码行数:25,代码来源:tcp_packet_sender.cpp

示例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);
}
开发者ID:DuanDechao,项目名称:shyloo,代码行数:24,代码来源:sltcp_packet_sender.cpp

示例4: send

//-------------------------------------------------------------------------------------
void Bundle::send(EndPoint& ep)
{
	BUNDLE_SEND_OP(ep.send(pPacket->data(), pPacket->totalSize()));
}
开发者ID:ChowZenki,项目名称:kbengine,代码行数:5,代码来源:bundle.cpp


注:本文中的EndPoint::send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。