本文整理汇总了C++中mercury::Channel::isDead方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::isDead方法的具体用法?C++ Channel::isDead怎么用?C++ Channel::isDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mercury::Channel
的用法示例。
在下文中一共展示了Channel::isDead方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postMail
//-------------------------------------------------------------------------------------
bool EntityMailboxAbstract::postMail(Mercury::Bundle& bundle)
{
KBE_ASSERT(Components::getSingleton().pNetworkInterface() != NULL);
Mercury::Channel* pChannel = getChannel();
if(pChannel && !pChannel->isDead())
{
bundle.send(*Components::getSingleton().pNetworkInterface(), pChannel);
return true;
}
else
{
ERROR_MSG("EntityMailboxAbstract::postMail: invalid channel(%s)!\n", addr_.c_str());
}
return false;
}
示例2:
//-------------------------------------------------------------------------------------
Proxy::~Proxy()
{
Baseapp::getSingleton().decProxicesCount();
// 如果被销毁频道仍然存活则将其关闭
Mercury::Channel* pChannel = Baseapp::getSingleton().networkInterface().findChannel(addr_);
if(pChannel && !pChannel->isDead())
{
Mercury::Bundle* pBundle = Mercury::Bundle::ObjPool().createObject();
(*pBundle).newMessage(ClientInterface::onKicked);
ClientInterface::onKickedArgs1::staticAddToBundle(*pBundle, SERVER_ERR_PROXY_DESTROYED);
//pBundle->send(Baseapp::getSingleton().networkInterface(), pChannel);
//Mercury::Bundle::ObjPool().reclaimObject(pBundle);
this->sendToClient(ClientInterface::onKicked, pBundle);
this->sendToClient();
pChannel->condemn();
}
SAFE_RELEASE(pProxyForwarder_);
}