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


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

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


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

示例1: AppLayerCCNHost


//.........这里部分代码省略.........

                // 未取得chunkを取得
                if(ccnMsg->msg_chunk_num > nodeData->return_lastRecvMsg(ccnMsg) + 1) {
                  CcnMsg* ccnMsg;
                  ccnMsg = new CcnMsg();
                  ccnMsg->resent_times = 1;
                  ccnMsg->ccn_method = DEFAULT;
                  ccnMsg->msg_type = Interest;
                  ccnMsg->msg_name = msg_videoData_name + node->nodeId % 3;
                  ccnMsg->msg_chunk_num = nodeData->return_lastRecvMsg(ccnMsg) + 1;
                  ccnMsg->EncodeFullNameMsg();
                  ccnMsg->sender_node_id = node->nodeId;
                  ccnMsg->source_node_id = source_node_id;
                  ccnMsg->payload_length = 30;
                  ccnMsg->hops_limit = 20;
                  ccnMsg->interest_genTime = node->getNodeTime();
                  ccnMsg->content_type = VideoData;
                  ccnMsg->end_chunk_num = UINT16_MAX;

                  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(ccnMsg->msg_chunk_num);
                  ccnMsg->data_genTime = it->second;

                  nodeData->reqMapSearch(node, ccnMsg);
                  nodeData->set_windowSize(node, ccnMsg);
                  nodeData->reqMapInput(node, ccnMsg);
                  nodeData->make_reTransMsg(node, ccnMsg);
                  nodeData->fibSend(node, ccnMsg);
                } else if (ccnMsg->msg_chunk_num == nodeData->return_lastRecvMsg(ccnMsg) + 1){
                  //printf("Got actual packet\n");
                } else {
                }
                nodeData->set_lastRecvMsg(ccnMsg);
                break;
              }


              if(nodeData->fibModSend(node, ccnMsg)) {
                delete ccnMsg;
                break;
              }
              break;
            }

            case fakeData:
            {
              // クライアントにデータ到着
              if(ccnMsg->source_node_id == node->nodeId) {
                delete ccnMsg;
                break;
              }

              nodeData->pitModSend(node, ccnMsg);
              break;
            }

            default:
              ERROR_ReportError("Undefined msg type\n");
          }
          break;
        }

        default:
          ERROR_ReportError("Undefined ccn_method\n");
      }
      break;
    }

    case MSG_APP_FromTransOpenResult:   // TCPでpassive open処理が終了
      //if(node->nodeId == 1) printf("openResult->connectionId: %lu\n", openResult->connectionId);
      break;
    case MSG_APP_FromTransListenResult: // コネクション要求待機状態を確立
      //if(node->nodeId == 1) printf("openResult->connectionId: %lu\n", openResult->connectionId);
      break;

    case MSG_APP_TimerExpired: 
    {  
      AppTimer* timer;
      timer = (AppTimer *)MESSAGE_ReturnInfo(msg);
      switch(timer->type) {
        case APP_TIMER_RE_SEND_PKT:
          nodeData->send_reTransMsg(node, timer->connectionId);
        break;
      }
      break;
    }
    case MSG_APP_FromTransCloseResult:
      break;
    default:
      printf("msg->eventType = %d\n", msg->eventType);
      ERROR_ReportError("msg->eventType error: undefined eventType\n");
  }
  MESSAGE_Free(node, msg);
}
开发者ID:LXiong,项目名称:ccn,代码行数:101,代码来源:ccn.cpp

示例2: AppLayerCCNClient


//.........这里部分代码省略.........
        }  // 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;

            clocktype send_delayTime;
            send_delayTime = ccnMsg->data_genTime - node->getNodeTime();
            if(send_delayTime < 0) send_delayTime = 0;

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

        case APP_TIMER_REGULAR_SEND_PKT:
        {
            //printf("この表示は 予想ではたくさんでる。APP_TIMER_REGULAR_SEND_PKT\n");
          clocktype send_delayTime;
          uint32_t chunk_num;
          map<uint32_t, clocktype>::iterator it;
          uint32_t next_msgName = global_node_data->return_MsgName();
          uint32_t end_chunk_num = next_msgName % 40 + 10;

          CcnMsg* ccnMsg;
          do {
            ccnMsg = new CcnMsg();
            ccnMsg->resent_times = 0;
            ccnMsg->ccn_method = DEFAULT;
            ccnMsg->msg_type = Interest;
            ccnMsg->msg_name = next_msgName;
            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 = 30;
            ccnMsg->hops_limit = 20;
            ccnMsg->content_type = CommonData;
            ccnMsg->end_chunk_num = end_chunk_num;
            ccnMsg->interest_genTime = node->getNodeTime();
            ccnMsg->data_genTime     = node->getNodeTime();
开发者ID:LXiong,项目名称:ccn,代码行数:67,代码来源:ccn.cpp


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