Exemplo n.º 1
0
//-------------------------------------------------------------------------------------
bool Proxy::sendToClient(bool expectData)
{
	if(!clientMailbox())
		return false;

	Mercury::Channel* pChannel = clientMailbox()->getChannel();
	if(!pChannel)
		return false;

	if(expectData)
	{
		if(pChannel->bundles().size() == 0)
		{
			WARNING_MSG("Proxy::sendToClient: no data!\n");
			return false;
		}
	}

	{
		// 如果数据大量阻塞发不出去将会报警
		AUTO_SCOPED_PROFILE("sendToClient");
		pChannel->send();
	}

	return true;
}
Exemplo n.º 2
0
//-------------------------------------------------------------------------------------
Witness::Bundles & Witness::bundles()
{
	KBE_ASSERT(pEntity_);
	KBE_ASSERT(pEntity_->getClientMailbox());
	Mercury::Channel* pChannel = pEntity_->getClientMailbox()->getChannel();
	KBE_ASSERT(pChannel);

	return pChannel->bundles();
}
Exemplo n.º 3
0
//-------------------------------------------------------------------------------------
Proxy::Bundles* Proxy::pBundles()
{
	if(!clientMailbox())
		return NULL;

	Mercury::Channel* pChannel = clientMailbox()->getChannel();
	if(!pChannel)
		return NULL;

	return &pChannel->bundles();
}