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


C++ NodeData::NewCcnMsg方法代码示例

本文整理汇总了C++中NodeData::NewCcnMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeData::NewCcnMsg方法的具体用法?C++ NodeData::NewCcnMsg怎么用?C++ NodeData::NewCcnMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NodeData的用法示例。


在下文中一共展示了NodeData::NewCcnMsg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AppLayerCCNHost


//.........这里部分代码省略.........
                // PROPOSAL再送での誤爆回避
                if(nodeData->ccn_method == PROPOSAL) {
                  if(ccnMsg->content_type == VideoData) {
                    nodeData->Cancel_reTransMsg(node, ccnMsg->msg_full_name);
                    nodeData->recvRequestData(node, ccnMsg);  // Statistical data 
                    delete ccnMsg;
                    break;  
                  }
                }

                // 再送パケットは次のパケットを要求しないため、ここで終了
                if(ccnMsg->resent_times > 0) {
                  if(ccnMsg->content_type == VideoData) {
                    if(nodeData->ccn_method == DEFAULT) {
                      nodeData->Cancel_reTransMsg(node, ccnMsg->msg_full_name);
                      nodeData->recvRequestData(node, ccnMsg);  // Statistical data 
                      delete ccnMsg;
                      break;
                    }
                    else if(nodeData->ccn_method == DEFAULT_FAST) {
                      nodeData->Cancel_reTransMsg(node, ccnMsg->msg_full_name);
                      nodeData->recvRequestData(node, ccnMsg);  // Statistical data 
                      delete ccnMsg;
                      break;
                    }
                  }
                }
                // 未取得chunkを取得
                if(nodeData->ccn_method == DEFAULT_FAST) {
                  if(ccnMsg->content_type == VideoData) {
                    if(ccnMsg->msg_chunk_num > nodeData->return_lastRecvMsg(ccnMsg) + 1) {

                      CcnMsg* t_ccnMsg;
                      t_ccnMsg = nodeData->NewCcnMsg(ccnMsg);
                      t_ccnMsg->msg_chunk_num = nodeData->return_lastRecvMsg(ccnMsg) + 1;
                      t_ccnMsg->EncodeFullNameMsg();
                      t_ccnMsg->payload_length = 30;
                      t_ccnMsg->resent_times = 1;
                      t_ccnMsg->msg_type = Interest;
                      t_ccnMsg->hops_limit = 20;

                      nodeData->reqMapSearch(node, t_ccnMsg);
                      nodeData->reqMapInput(node, t_ccnMsg);

                      nodeData->Cancel_reTransMsg(node, t_ccnMsg->msg_full_name);
                      nodeData->make_reTransMsg(node, t_ccnMsg);

                      Node* source_node;
                      map<uint32_t, clocktype>::iterator it;
                      source_node = MAPPING_GetNodePtrFromHash(GlobalNodeData::nodeHash, source_node_id);
                      nodeData->source_nodeData = (NodeData*)source_node->appData.nodeData;
                      NodeData* source_nodeData;
                      source_nodeData = nodeData->source_nodeData;

                      it = source_nodeData->dataGenerateTime_map.find(t_ccnMsg->msg_chunk_num);
                      t_ccnMsg->data_genTime = it->second;

                      nodeData->set_windowSize(node, t_ccnMsg);
                      nodeData->fibSend(node, t_ccnMsg);
                    }
                  }
                }
                nodeData->release_windowSize(node, ccnMsg);

                nodeData->set_lastRecvMsg(ccnMsg);
                nodeData->Cancel_reTransMsg(node, ccnMsg->msg_full_name);
开发者ID:LXiong,项目名称:ccn,代码行数:67,代码来源:ccn.cpp

示例2: AppLayerCCNClient


//.........这里部分代码省略.........
          break;
        }  // APP_TIMER_SEND_PKT
        
        case APP_TIMER_DATA_SEND_PKT:
        {
            printf("この表示がなければ、APP_TIMER_DATA_SEND_PKTはいらない子。てかどうやってここはいるんだ… ");

          CcnMsg* ccnMsg;
          for(int i = 0; i < 3; i++) {
            ccnMsg = new CcnMsg();
            ccnMsg->resent_times = 0;
            ccnMsg->ccn_method = PRIOR;
            ccnMsg->msg_type = Data;
            ccnMsg->msg_name = msg_videoData_name + i;
            ccnMsg->msg_chunk_num = nodeData->return_lastChunkNum(ccnMsg) + 1;
            ccnMsg->EncodeFullNameMsg();
            ccnMsg->sender_node_id = node->nodeId;
            ccnMsg->source_node_id = source_node_id;
            ccnMsg->payload_length = nodeData->tcp_mss;
            ccnMsg->hops_limit = 20;
            ccnMsg->interest_genTime = node->getNodeTime();
            ccnMsg->content_type = VideoData;
            ccnMsg->end_chunk_num = UINT32_MAX;
            
            map<uint32_t, clocktype>::iterator it;
            it = nodeData->dataGenerateTime_map.find(ccnMsg->msg_chunk_num);
            ccnMsg->data_genTime = it->second;
    
            clocktype send_delayTime;
            send_delayTime = ccnMsg->data_genTime - node->getNodeTime();
            if(send_delayTime < 0) send_delayTime = 0;

            nodeData->set_lastChunkNum(ccnMsg);
            nodeData->pitSend_PRIOR(node, nodeData->NewCcnMsg(ccnMsg), send_delayTime);
            APP_SetTimer(node, APP_CCN_CLIENT, 0, APP_CCN_LISTEN_PORT, APP_TIMER_DATA_SEND_PKT, send_delayTime);
          }
          delete ccnMsg;
          break;
        }  // APP_TIMER_DATA_SEND_PKT

        case APP_TIMER_fakeINTEREST_SEND_PKT:
        {
            printf("この表示がなければ、APP_TIMER_fakeINTEREST_SEND_PKTはいらない子。てかここどうやって入るんだ… ");

          // 動画の配信分をすべて出す
          CcnMsg* ccnMsg;
          for(int i = 0; i < 3; i++) {
            ccnMsg = new CcnMsg();
            ccnMsg->resent_times = 0;
            ccnMsg->ccn_method = PROPOSAL;
            ccnMsg->msg_type = fakeInterest;
            ccnMsg->msg_name = msg_videoData_name + i;
            ccnMsg->msg_chunk_num = nodeData->return_lastChunkNum(ccnMsg) + 1;
            ccnMsg->EncodeFullNameMsg();
            ccnMsg->sender_node_id = node->nodeId;
            ccnMsg->source_node_id = source_node_id;
            ccnMsg->payload_length = nodeData->tcp_mss;
            ccnMsg->hops_limit = 20;
            ccnMsg->interest_genTime = node->getNodeTime();
            ccnMsg->content_type = VideoData;
            ccnMsg->end_chunk_num = UINT32_MAX;
            
            map<uint32_t, clocktype>::iterator it;
            it = nodeData->dataGenerateTime_map.find(ccnMsg->msg_chunk_num);
            ccnMsg->data_genTime = it->second;
开发者ID:LXiong,项目名称:ccn,代码行数:66,代码来源:ccn.cpp


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