本文整理汇总了C++中AccountHandler::send方法的典型用法代码示例。如果您正苦于以下问题:C++ AccountHandler::send方法的具体用法?C++ AccountHandler::send怎么用?C++ AccountHandler::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountHandler
的用法示例。
在下文中一共展示了AccountHandler::send方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _restartAsMaster
void AbiCollab::_restartAsMaster()
{
UT_DEBUGMSG(("AbiCollab::_restartAsMaster()\n"));
m_Import.masterInit();
m_Export.masterInit();
// the session controller will never have to revert individual changerecords,
// so we can re-enable changerecord coalescing
// FIXME: enable this
//pDoc->setCoalescingMask(true);
// inform everyone that we can restart this session
SessionReconnectAckPacket srap(m_sId, m_pDoc->getDocUUIDString(), m_pDoc->getCRNumber());
for (std::map<BuddyPtr, std::string>::iterator it = m_vCollaborators.begin(); it != m_vCollaborators.end(); it++)
{
BuddyPtr pBuddy = (*it).first;
UT_continue_if_fail(pBuddy);
AccountHandler* pHandler = pBuddy->getHandler();
UT_continue_if_fail(pHandler);
pHandler->send(&srap, pBuddy);
}
// we're the master now!
m_eTakeoveState = STS_NONE;
_pushOutgoingQueue();
}
示例2: push
/*!
* Send this packet. Note, the specified packet does still belong to the calling class.
* So if we want to store it (for masking), we HAVE to clone it first
*/
void AbiCollab::push(SessionPacket* pPacket)
{
UT_DEBUGMSG(("AbiCollab::push()\n"));
UT_return_if_fail(pPacket);
if (m_bIsReverting)
{
UT_DEBUGMSG(("This packet was generated by a local revert triggerd in the import; dropping on the floor!\n"));
return;
}
if (m_bExportMasked)
{
m_vecMaskedPackets.push_back(static_cast<SessionPacket*>(pPacket->clone())); // TODO: make this a shared ptr, so we don't need to clone the packet
return;
}
if (!isLocallyControlled() && m_eTakeoveState != STS_NONE)
{
// TODO: revert ack packets should still go to old master
// (or be dropped on the floor, as he probably is not even around anymore)
UT_DEBUGMSG(("We're in the middle of a session takeover; holding on to the packet until the new master is ready"));
m_vOutgoingQueue.push_back(static_cast<SessionPacket*>(pPacket->clone())); // TODO: make this a shared ptr, so we don't need to clone the packet
return;
}
// record
if (m_pRecorder)
m_pRecorder->storeOutgoing( const_cast<const SessionPacket*>( pPacket ) );
// TODO: this could go in the session manager
UT_DEBUGMSG(("Pusing packet to %d collaborators\n", m_vCollaborators.size()));
for (std::map<BuddyPtr, std::string>::iterator it = m_vCollaborators.begin(); it != m_vCollaborators.end(); it++)
{
BuddyPtr pCollaborator = (*it).first;
UT_continue_if_fail(pCollaborator);
UT_DEBUGMSG(("Pushing packet to collaborator with descriptor: %s\n", pCollaborator->getDescriptor(true).utf8_str()));
AccountHandler* pHandler = pCollaborator->getHandler();
UT_continue_if_fail(pHandler);
// overwrite remote revision for this collaborator
_fillRemoteRev(pPacket, pCollaborator);
// send!
bool res = pHandler->send(pPacket, pCollaborator);
if (!res)
{
UT_DEBUGMSG(("Error sending a packet!\n"));
}
}
}