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/ADCSensorMain.cpp b/src/ADCSensorMain.cpp
index d7f1b2d..4987f1f 100644
--- a/src/ADCSensorMain.cpp
+++ b/src/ADCSensorMain.cpp
@@ -308,7 +308,7 @@
auto sensorsChanged =
std::make_shared<boost::container::flat_set<std::string>>();
- io.post([&]() {
+ boost::asio::post(io, [&]() {
createSensors(io, objectServer, sensors, systemBus, nullptr,
UpdateType::init);
});
@@ -323,7 +323,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)
@@ -374,7 +374,7 @@
}
// this implicitly cancels the timer
- cpuFilterTimer.expires_from_now(std::chrono::seconds(1));
+ cpuFilterTimer.expires_after(std::chrono::seconds(1));
cpuFilterTimer.async_wait([&](const boost::system::error_code& ec) {
if (ec == boost::asio::error::operation_aborted)