Move asio interfaces away from deprecated names
The intent of this commit is to allow building asio based event loops in
applications with BOOST_ASIO_NO_DEPRECATED flag set. This change is
largely a sed replace of io_service with io_context.
This will allow us to move to the networking TS at such time that it is
mature. Details on depreated interfaces are available here for
reference:
https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/net_ts.html
Change-Id: Ie3cc699effcf855a649dee5bfce2f6616109429b
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/sdbusplus/asio/connection.hpp b/sdbusplus/asio/connection.hpp
index 8fbd08a..bafa4c6 100644
--- a/sdbusplus/asio/connection.hpp
+++ b/sdbusplus/asio/connection.hpp
@@ -46,13 +46,13 @@
{
public:
// default to system bus
- connection(boost::asio::io_service& io) :
+ connection(boost::asio::io_context& io) :
sdbusplus::bus::bus(sdbusplus::bus::new_default()), io_(io), socket(io_)
{
socket.assign(get_fd());
read_wait();
}
- connection(boost::asio::io_service& io, sd_bus* bus) :
+ connection(boost::asio::io_context& io, sd_bus* bus) :
sdbusplus::bus::bus(bus), io_(io), socket(io_)
{
socket.assign(get_fd());
@@ -202,13 +202,13 @@
}
}
- boost::asio::io_service& get_io_service()
+ boost::asio::io_context& get_io_context()
{
return io_;
}
private:
- boost::asio::io_service& io_;
+ boost::asio::io_context& io_;
boost::asio::posix::stream_descriptor socket;
void read_wait()
@@ -228,7 +228,7 @@
}
void read_immediate()
{
- io_.post([&] {
+ boost::asio::post(io_, [&] {
if (process_discard())
{
read_immediate();