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


C++ Slave::reportMO方法代码示例

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


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

示例1: SPEHandler


//.........这里部分代码省略.........
               int id = 0;
               self->m_GMP.sendto(ip.c_str(), ctrlport, id, &msg);
            }
         }
      }

      // if buckets = 0, send back to clients, otherwise deliver to local or network locations
      if ((buckets != 0) && (progress >= 0))
         deliverystatus = self->deliverResult(buckets, result, dest);

      if (deliverystatus < 0)
         progress = SectorError::E_SPEWRITE;
      else
         progress = 100;

      self->m_SectorLog << LogStart(LogLevel::LEVEL_3) << "SPE completed " << progress << " " << ip << " " << ctrlport << LogEnd();

      msg.setData(4, (char*)&progress, 4);

      if (100 == progress)
      {
         msg.m_iDataLength = SectorMsg::m_iHdrSize + 8;
         int id = 0;
         self->m_GMP.sendto(ip.c_str(), ctrlport, id, &msg);

         self->sendResultToClient(buckets, dest.m_piSArray, dest.m_piRArray, result, ip, dataport, transid);
         dest.reset(buckets);

         // report new files
         vector<string> filelist;
         for (set<string>::iterator i = file.m_sstrFiles.begin(); i != file.m_sstrFiles.end(); ++ i)
            filelist.push_back(*i);
         self->report(master_ip, master_port, transid, filelist, +FileChangeType::FILE_UPDATE_NEW);
         self->reportMO(master_ip, master_port, transid);
      }
      else
      {
         msg.setData(8, (char*)&processstatus, 4);
         msg.m_iDataLength = SectorMsg::m_iHdrSize + 12;
         if (output.m_strError.length() > 0)
            msg.setData(12, output.m_strError.c_str(), output.m_strError.length() + 1);
         else if (deliverystatus < 0)
         {
            string tmp = "System Error: data transfer to buckets failed.";
            msg.setData(12, tmp.c_str(), tmp.length() + 1);
         }

         int id = 0;
         self->m_GMP.sendto(ip.c_str(), ctrlport, id, &msg);
      }

      delete [] index;
      delete [] block;
      delete [] output.m_pcResult;
      delete [] output.m_pllIndex;
      delete [] output.m_piBucketID;
      index = NULL;
      block = NULL;
   }

   gettimeofday(&t2, 0);
   int duration = t2.tv_sec - t1.tv_sec;
   self->m_SectorLog << LogStart(LogLevel::LEVEL_3) << "comp server closed " << ip << " " << ctrlport << " " << duration << LogEnd();

   delete [] param;
开发者ID:norouzi4d,项目名称:sector,代码行数:66,代码来源:serv_spe.cpp


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