本文整理汇总了C++中network::Channel::networkInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::networkInterface方法的具体用法?C++ Channel::networkInterface怎么用?C++ Channel::networkInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类network::Channel
的用法示例。
在下文中一共展示了Channel::networkInterface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDataChanged
//-------------------------------------------------------------------------------------
void GlobalDataClient::onDataChanged(PyObject* key, PyObject* value, bool isDelete)
{
std::string skey = script::Pickler::pickle(key, 0);
std::string sval = "";
if(value)
sval = script::Pickler::pickle(value, 0);
Components::COMPONENTS& channels = Components::getSingleton().getComponents(serverComponentType_);
Components::COMPONENTS::iterator iter1 = channels.begin();
uint8 dataType = dataType_;
ArraySize slen = 0;
for(; iter1 != channels.end(); iter1++)
{
Network::Channel* lpChannel = iter1->pChannel;
KBE_ASSERT(lpChannel != NULL);
Network::Bundle* pBundle = Network::Bundle::ObjPool().createObject();
(*pBundle).newMessage(DbmgrInterface::onBroadcastGlobalDataChanged);
(*pBundle) << dataType;
(*pBundle) << isDelete;
slen = skey.size();
(*pBundle) << slen;
(*pBundle).assign(skey.data(), slen);
if(!isDelete)
{
slen = sval.size();
(*pBundle) << slen;
(*pBundle).assign(sval.data(), slen);
}
(*pBundle) << g_componentType;
(*pBundle).send(lpChannel->networkInterface(), lpChannel);
Network::Bundle::ObjPool().reclaimObject(pBundle);
}
}