void loop() { boost::asio::io_service::work work(getIoService()); while (isAlive()) { boost::system::error_code ec; getIoService().reset(); if (!getIoService().run(ec)) { std::this_thread::sleep_for(std::chrono::milliseconds(10)); } } *mLog.debug() << UTILS_STR_FUNCTION << ", done"; }