本文整理汇总了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);
}
}