本文整理汇总了C++中MessageHeader::getMsgId方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageHeader::getMsgId方法的具体用法?C++ MessageHeader::getMsgId怎么用?C++ MessageHeader::getMsgId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageHeader
的用法示例。
在下文中一共展示了MessageHeader::getMsgId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: broadcastDataMessage
int MessagingService::broadcastDataMessage (const char *pszMessageID, const char *pszTargetNodeId, int64 i64TimeOut,
uint8 ui8Priority, bool bRequireAck, const char *pszLogMsg, const char *pszHints)
{
if (_pDataCacheInterface == NULL) {
return -7;
}
MessageHeader *pMH = _pDataCacheInterface->getMessageInfo (pszMessageID);
if (pMH == NULL) {
checkAndLogMsg ("MessagingService::sendMessage", Logger::L_Warning,
"Can not send message %s; MessageInfo could not be found/instantiated\n",
pszMessageID);
return -6;
}
pMH->setPriority (ui8Priority);
pMH->setAcknowledgment (bRequireAck);
int rc = broadcastDataMessage (pMH, pszTargetNodeId, i64TimeOut, pszLogMsg, pszHints);
_pDataCacheInterface->release (pMH->getMsgId(), pMH);
return rc;
}
示例2: sendUnsentMessagesTo
void AckController::sendUnsentMessagesTo (MessageByTarget *pMBT, const char *pszTarget)
{
const char *pszMethodName = "AckController::sendQueuedMessagesTo";
MessageHeader *pMHTmp;
MessageHeader *pMH = pMBT->unsentMessages.getFirst();
while ((pMH != NULL) && (pMBT->unacknowledgedMessages.getCount() < _ui8TransmissionWindow)) {
// send the message
if (broadcastDataMessage (pMH, pszTarget, _i64TimeOut, "Sending queued message") == 0) {
// and add it to the unacknowledged messages list
pMBT->unacknowledgedMessages.put (pMH->getMsgId(),
new MessageState (getTimeInMilliseconds(), _i64TimeOut));
checkAndLogMsg (pszMethodName, Logger::L_Info,
"Transmission Window is %d, waiting for ack messages %d\n",
_ui8TransmissionWindow, pMBT->unacknowledgedMessages.getCount());
}
// remove the message from the queue of the unsent messages
pMHTmp = pMBT->unsentMessages.getNext();
pMH = pMBT->unsentMessages.remove (pMH);
delete pMH;
pMH = pMHTmp;
}
}