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


C++ HttpMessage::toIndentedString方法代码示例

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


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

示例1: execute

void MsgClient::execute(const size_t TimeBetweenMessages, const size_t NumMessages)
{
  // send NumMessages messages
  
  ClientCounter counter;
  size_t myCount = counter.count();
  std::string myCountString = Utilities::Converter<size_t>::toString(myCount);

  Show::attach(&std::cout);
  Show::start();

  Show::title(
    "Starting HttpMessage client" + myCountString + 
    " on thread " + Utilities::Converter<std::thread::id>::toString(std::this_thread::get_id())
  );
  try
  {
    SocketSystem ss;
    SocketConnecter si;
    while (!si.connect("localhost", 8080))
    {
      Show::write("\n client waiting to connect");
      ::Sleep(100);
    }
    HttpMessage msg;
	//test for upload files
	sendFolder(si);
	//test for upload dependency
	sendDependency(si);
	// send message to check out get all the list of files
	//sendGetFolderList(si);
	//readMessage(si);
	//test for get file

	std::string path = "../Repository/SunMay11903202016";
	sendDownloadWithout(si,path);
	::Sleep(200);
	receiveFile(si);
	receiveFile(si);
	Show::write("\n\n  client sent\n" + msg.toIndentedString());

    msg = makeMessage(1, "quit", "toAddr:localhost:8080");
    sendMessage(msg, si);
    Show::write("\n\n  client" + myCountString + " sent\n" + msg.toIndentedString());
    Show::write("\n");
    Show::write("\n  All done folks");
  }
  catch (std::exception& exc)
  {
    Show::write("\n  Exeception caught: ");
    std::string exMsg = "\n  " + std::string(exc.what()) + "\n\n";
    Show::write(exMsg);
  }
}
开发者ID:TQJADE,项目名称:Parser,代码行数:54,代码来源:MsgClient.cpp


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