Don't use deprecated asio functions
This code used a number of asio functions that have been deprecated.
This patch replaces them with their new equivalents, and enabled
BOOST_ASIO_NO_DEPRECATED.
Change-Id: I98bddba4c7d72a53ceca9455429828e60f06c5e0
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/src/FanMain.cpp b/src/FanMain.cpp
index 2756213..5042fb6 100644
--- a/src/FanMain.cpp
+++ b/src/FanMain.cpp
@@ -556,7 +556,7 @@
auto sensorsChanged =
std::make_shared<boost::container::flat_set<std::string>>();
- io.post([&]() {
+ boost::asio::post(io, [&]() {
createSensors(io, objectServer, tachSensors, pwmSensors, systemBus,
nullptr);
});
@@ -571,7 +571,7 @@
}
sensorsChanged->insert(message.get_path());
// this implicitly cancels the timer
- filterTimer.expires_from_now(std::chrono::seconds(1));
+ filterTimer.expires_after(std::chrono::seconds(1));
filterTimer.async_wait([&](const boost::system::error_code& ec) {
if (ec == boost::asio::error::operation_aborted)