| 97 | } |
| 98 | |
| 99 | void OHDUtil::keep_alive_until_sigterm() { |
| 100 | static bool quit = false; |
| 101 | signal(SIGTERM, [](int sig) { quit = true; }); |
| 102 | while (!quit) { |
| 103 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 104 | openhd::log::get_default()->debug("keep_alive_until_sigterm"); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | bool OHDUtil::is_valid_ip(const std::string& ip) { |
| 109 | unsigned char buf[sizeof(struct in6_addr)]; |