tools: switch to Face::getIoContext()

Change-Id: I6be4c682d62e1061af45052d2141b9e5b9e897c5
diff --git a/tools/ndn-autoconfig/main.cpp b/tools/ndn-autoconfig/main.cpp
index 3b30001..9602a92 100644
--- a/tools/ndn-autoconfig/main.cpp
+++ b/tools/ndn-autoconfig/main.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -60,10 +60,10 @@
 static void
 runDaemon(Procedure& proc)
 {
-  boost::asio::signal_set terminateSignals(proc.getIoService());
+  boost::asio::signal_set terminateSignals(proc.getIoContext());
   terminateSignals.add(SIGINT);
   terminateSignals.add(SIGTERM);
-  terminateSignals.async_wait([&] (const boost::system::error_code& error, int signalNo) {
+  terminateSignals.async_wait([&] (const auto& error, int signalNo) {
     if (error) {
       return;
     }
@@ -76,10 +76,10 @@
       std::cerr << signalName;
     }
     std::cerr << std::endl;
-    proc.getIoService().stop();
+    proc.getIoContext().stop();
   });
 
-  Scheduler sched(proc.getIoService());
+  Scheduler sched(proc.getIoContext());
   scheduler::ScopedEventId runEvt;
   auto scheduleRerun = [&] (time::nanoseconds delay) {
     runEvt = sched.schedule(delay, [&] { proc.runOnce(); });
@@ -89,11 +89,11 @@
     scheduleRerun(DAEMON_UNCONDITIONAL_INTERVAL);
   });
 
-  net::NetworkMonitor netmon(proc.getIoService());
+  net::NetworkMonitor netmon(proc.getIoContext());
   netmon.onNetworkStateChanged.connect([&] { scheduleRerun(NETMON_DAMPEN_PERIOD); });
 
   scheduleRerun(DAEMON_INITIAL_DELAY);
-  proc.getIoService().run();
+  proc.getIoContext().run();
 }
 
 static int
diff --git a/tools/ndn-autoconfig/procedure.cpp b/tools/ndn-autoconfig/procedure.cpp
index f7295d3..ebeaae2 100644
--- a/tools/ndn-autoconfig/procedure.cpp
+++ b/tools/ndn-autoconfig/procedure.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  Regents of the University of California,
+ * Copyright (c) 2014-2023,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -108,7 +108,7 @@
       std::cerr << "Failed to canonize HUB FaceUri: " << reason << std::endl;
       this->onComplete(false);
     },
-    m_face.getIoService(), FACEURI_CANONIZE_TIMEOUT);
+    m_face.getIoContext(), FACEURI_CANONIZE_TIMEOUT);
 }
 
 void
diff --git a/tools/ndn-autoconfig/procedure.hpp b/tools/ndn-autoconfig/procedure.hpp
index d9513ed..a15b117 100644
--- a/tools/ndn-autoconfig/procedure.hpp
+++ b/tools/ndn-autoconfig/procedure.hpp
@@ -52,15 +52,16 @@
   void
   initialize(const Options& options);
 
-  /** \brief Run HUB discovery procedure once.
+  /**
+   * \brief Run the HUB discovery procedure once.
    */
   void
   runOnce();
 
   boost::asio::io_context&
-  getIoService()
+  getIoContext() const noexcept
   {
-    return m_face.getIoService();
+    return m_face.getIoContext();
   }
 
 private: