当前位置: 首页>>代码示例>>C++>>正文


C++ MessageHeader::getMsgId方法代码示例

本文整理汇总了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;
}
开发者ID:ihmc,项目名称:nomads,代码行数:21,代码来源:Services.cpp

示例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;
    }
}
开发者ID:agilecomputing,项目名称:nomads,代码行数:24,代码来源:AckController.cpp


注:本文中的MessageHeader::getMsgId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。