Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <KeepAlive/IKeepAliveClient.hpp>
- #include <KeepAlive/WSKeepAliveClient.hpp>
- int main()
- {
- boost::asio::io_context ioc;//{ 2 };
- boost::asio::io_context ioc2;
- //ssl::context ctx{ ssl::context::sslv23 };
- //auto keepAlive = std::make_shared<KeepAliveClientSecure>(ioc,std::move(ctx));
- auto conf = std::make_shared<JsonReader>("./config/config.json");
- conf->RefreshData();
- auto keepAlive = std::make_shared<KeepAliveClient>(conf, std::string("KeepAlive1"), ioc);
- auto keepAlive2 = std::make_shared<KeepAliveClient>(conf, std::string("KeepAlive2"), ioc);
- std::string name = "Tester";
- keepAlive->Reconfigure(name);
- std::cout << "Connected to KeepAlive as " << name << std::endl;
- keepAlive2->Reconfigure(name + "2");
- std::cout << "Connected to KeepAlive2 as " << name << std::endl;
- while (1)
- {
- keepAlive->Send();
- keepAlive2->Send();
- std::this_thread::sleep_for(std::chrono::seconds(1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement