Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http::request<req_body> req = RequestToGetNeededCategories(epoint_.address().to_string(), std::vector<std::wstring>{}, "CLIENT_BROTHER");
- http::request<req_body> req2 = RequestToGetAllCategories(epoint_.address().to_string(), "CLIENT_BROTHER");
- http::request<req_body> req3 = RequestToShowCategories(epoint_.address().to_string(), "CLIENT_BROTHER");
- req.prepare_payload();
- req2.prepare_payload();
- req3.prepare_payload();
- sock_.connect(epoint_);
- sock_.set_option(tcp::socket::keep_alive(true));
- http::write(sock_, req);
- beast::flat_buffer flb;
- boost::system::error_code ec;
- http::response<req_body> resp1;
- http::read(sock_, flb, resp1, ec);
- std::string aff(resp1.body().begin(), resp1.body().end());
- std::wstring ws16(ToWstr(aff));
- std::wcout<< L"respomce:" << ws16 << std::endl;
- if(ec){
- std::wcout<< L"ERR^ " << ToWstr(ec.message())<< std::endl;
- }
- flb.clear();
- //ОТСЮДА НАЧИНАЮТСЯ ПРОБЛЕМЫ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- http::write(sock_, req2);
- http::response<req_body> resp2;
- http::read(sock_, flb, resp2, ec);
- std::string qaff(resp2.body().begin(), resp2.body().end());
- std::wstring qws16(ToWstr(qaff));
- std::wcout<< L"respomce:" << qws16 << std::endl;
- if(ec){
- std::wcout<< L"EXXXXXXXXXXXXXX^ " << ToWstr(ec.message())<< std::endl;
- ловит: END OF STREAM
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement