]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3112] renamed getIOService to getInternalIOService
authorRazvan Becheriu <razvan@isc.org>
Wed, 22 Nov 2023 15:22:55 +0000 (17:22 +0200)
committerRazvan Becheriu <razvan@isc.org>
Mon, 11 Dec 2023 07:52:05 +0000 (09:52 +0200)
49 files changed:
src/bin/agent/ca_process.cc
src/bin/agent/tests/ca_command_mgr_unittests.cc
src/bin/d2/d2_process.cc
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc
src/bin/netconf/netconf_process.cc
src/bin/netconf/tests/control_socket_unittests.cc
src/bin/netconf/tests/netconf_unittests.cc
src/hooks/dhcp/high_availability/tests/ha_mt_unittest.cc
src/hooks/dhcp/high_availability/tests/ha_service_unittest.cc
src/hooks/dhcp/high_availability/tests/ha_test.cc
src/lib/asiodns/io_fetch.cc
src/lib/asiodns/tests/io_fetch_unittest.cc
src/lib/asiolink/interval_timer.cc
src/lib/asiolink/io_acceptor.h
src/lib/asiolink/io_service.cc
src/lib/asiolink/io_service.h
src/lib/asiolink/io_service_signal.cc
src/lib/asiolink/openssl_tls.h
src/lib/asiolink/tcp_socket.h
src/lib/asiolink/tests/interval_timer_unittest.cc
src/lib/asiolink/tests/tcp_acceptor_unittest.cc
src/lib/asiolink/tests/tcp_socket_unittest.cc
src/lib/asiolink/tests/tls_acceptor_unittest.cc
src/lib/asiolink/tests/tls_socket_unittest.cc
src/lib/asiolink/tests/tls_unittest.cc
src/lib/asiolink/tests/udp_socket_unittest.cc
src/lib/asiolink/testutils/test_server_unix_socket.cc
src/lib/asiolink/udp_socket.h
src/lib/asiolink/unix_domain_socket.cc
src/lib/d2srv/tests/dns_client_unittests.cc
src/lib/d2srv/testutils/nc_test_utils.cc
src/lib/dhcp_ddns/ncr_io.cc
src/lib/dhcp_ddns/ncr_udp.cc
src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc
src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc
src/lib/dhcpsrv/tests/cfg_iface_unittest.cc
src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/timer_mgr_unittest.cc
src/lib/http/tests/server_client_unittests.cc
src/lib/http/tests/test_http_client.h
src/lib/http/tests/tls_client_unittests.cc
src/lib/http/tests/tls_server_unittests.cc
src/lib/process/d_controller.cc
src/lib/tcp/tests/tcp_listener_unittests.cc
src/lib/tcp/tests/tcp_test_client.h
src/lib/tcp/tests/tls_listener_unittests.cc

index 9e6665ff98fd8ca7d606dfc45d79c1959b83cc27..3a3cebae90cced6e1c4d3bb531a5e71a13a96490 100644 (file)
@@ -88,9 +88,9 @@ CtrlAgentProcess::run() {
 
 size_t
 CtrlAgentProcess::runIO() {
-    size_t cnt = getIOService()->getIOService().poll();
+    size_t cnt = getIOService()->poll();
     if (!cnt) {
-        cnt = getIOService()->getIOService().run_one();
+        cnt = getIOService()->runOne();
     }
     return (cnt);
 }
@@ -208,7 +208,7 @@ CtrlAgentProcess::garbageCollectListeners(size_t leaving) {
         }
         // We have stopped listeners but there may be some pending handlers
         // related to these listeners. Need to invoke these handlers.
-        getIOService()->getIOService().poll();
+        getIOService()->poll();
         // Finally, we're ready to remove no longer used listeners.
         http_listeners_.erase(http_listeners_.begin(),
                               http_listeners_.end() - leaving);
index 275961bd695e2c796ea346290bacaced5b15616a..939e55f063d17f6e002f5d04708db1626614be8c 100644 (file)
@@ -248,7 +248,7 @@ public:
 
         // We have some cancelled operations for which we need to invoke the
         // handlers with the operation_aborted error code.
-        getIOService()->getIOService().reset();
+        getIOService()->restart();
         getIOService()->poll();
 
         EXPECT_EQ(expected_responses, server_socket_->getResponseNum());
@@ -413,7 +413,7 @@ TEST_F(CtrlAgentCommandMgrTest, forwardListCommands) {
 
     // We have some cancelled operations for which we need to invoke the
     // handlers with the operation_aborted error code.
-    getIOService()->getIOService().reset();
+    getIOService()->restart();
     getIOService()->poll();
 
     // Answer of 3 is specific to the stub response we send when the
index 5cfcda6422cf9e1c72e5ff436aee37bc082519b9..426f95f2a924d13b6319713a676f087b62afbe23 100644 (file)
@@ -141,12 +141,12 @@ D2Process::runIO() {
 
     // Poll runs all that are ready. If none are ready it returns immediately
     // with a count of zero.
-    size_t cnt = getIOService()->getIOService().poll();
+    size_t cnt = getIOService()->poll();
     if (!cnt) {
         // Poll ran no handlers either none are ready or the service has been
-        // stopped.  Either way, call run_one to wait for a IO event. If the
+        // stopped.  Either way, call runOne to wait for a IO event. If the
         // service is stopped it will return immediately with a cnt of zero.
-        cnt = getIOService()->getIOService().run_one();
+        cnt = getIOService()->runOne();
     }
 
     return (cnt);
index 4cf10464bd202ae5c395f4ac107f67544f3ea42d..0e55a5d3818f35b8676ad770fa2cc33410b6c140 100644 (file)
@@ -1303,7 +1303,6 @@ ControlledDhcpv4Srv::~ControlledDhcpv4Srv() {
     } catch (...) {
         // Don't want to throw exceptions from the destructor. The server
         // is shutting down anyway.
-        ;
     }
 
     server_ = NULL; // forget this instance. There should be no callback anymore
index 170a69d505f56352d829b3d4c85232106048238c..9e06434fec438cd6226231865afd15d40d898536 100644 (file)
@@ -241,7 +241,7 @@ public:
         while (!stopped && (!cond || !cond())) {
             io_service->runOne();
         }
-        io_service->getIOService().reset();
+        io_service->restart();
     }
 
     /// @brief This test verifies that the timer used to fetch the configuration
index ec19ba046ba1ee4167cfb3a7cc71ffaa5ff1f8c8..514df2bb1ec6ad7342c0296b4d1a514889de82f6 100644 (file)
@@ -1322,7 +1322,6 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
     } catch (...) {
         // Don't want to throw exceptions from the destructor. The server
         // is shutting down anyway.
-        ;
     }
 
     server_ = NULL; // forget this instance. There should be no callback anymore
index e7b7780affa5934ca0558a1b12e04ba835b8e316..2458cb9d6bfe0a0593d3384ac79308da804d49af 100644 (file)
@@ -228,7 +228,7 @@ public:
         while (!stopped && (!cond || !cond())) {
             io_service->runOne();
         }
-        io_service->getIOService().reset();
+        io_service->restart();
     }
 
     /// @brief This test verifies that the timer used to fetch the configuration
index 4c334b6a6e04d959bf0ec8c15374eab2d783d57a..c0f9b23a1688bb14a493053fa7b4e8c73590e61c 100644 (file)
@@ -65,9 +65,9 @@ NetconfProcess::run() {
 
 size_t
 NetconfProcess::runIO() {
-    size_t cnt = getIOService()->getIOService().poll();
+    size_t cnt = getIOService()->poll();
     if (!cnt) {
-        cnt = getIOService()->getIOService().run_one();
+        cnt = getIOService()->runOne();
     }
     return (cnt);
 }
index 7208f083acb0eff239b634acf459da1db5e89371..c284a226d1a149d8609404cee800c5dcbe0dab46 100644 (file)
@@ -211,14 +211,14 @@ void
 UnixControlSocketTest::reflectServer() {
     // Acceptor.
     boost::asio::local::stream_protocol::acceptor
-        acceptor(io_service_.getIOService());
+        acceptor(io_service_.getInternalIOService());
     EXPECT_NO_THROW_LOG(acceptor.open());
     boost::asio::local::stream_protocol::endpoint
         endpoint(unixSocketFilePath());
     EXPECT_NO_THROW_LOG(acceptor.bind(endpoint));
     EXPECT_NO_THROW_LOG(acceptor.listen());
     boost::asio::local::stream_protocol::socket
-        socket(io_service_.getIOService());
+        socket(io_service_.getInternalIOService());
 
     // Ready.
     signalReady();
index 26c3d7809b7f387a9367b1c2ccea8711298fd215..9a58b8a587d856d0c39197b511e861aace12ec79 100644 (file)
@@ -259,7 +259,7 @@ void
 NetconfAgentTest::fakeServer() {
     // Acceptor.
     boost::asio::local::stream_protocol::acceptor
-        acceptor(io_service_->getIOService());
+        acceptor(io_service_->getInternalIOService());
     EXPECT_NO_THROW_LOG(acceptor.open());
     boost::asio::local::stream_protocol::endpoint
         endpoint(unixSocketFilePath());
@@ -268,7 +268,7 @@ NetconfAgentTest::fakeServer() {
     EXPECT_NO_THROW_LOG(acceptor.bind(endpoint));
     EXPECT_NO_THROW_LOG(acceptor.listen());
     boost::asio::local::stream_protocol::socket
-        socket(io_service_->getIOService());
+        socket(io_service_->getInternalIOService());
 
     // Ready.
     signalReady();
index ed9fa7d008afcba08057c7f3d3c1077bb2c5c38c..36ca35e4393c67db8d4ddd657d92e15559e84bef 100644 (file)
@@ -134,7 +134,7 @@ public:
     ///
     /// Stops all test servers.
     ~HAMtServiceTest() {
-        io_service_->getIOService().reset();
+        io_service_->restart();
         io_service_->poll();
         MultiThreadingMgr::instance().setMode(false);
         CmdResponseCreator::command_accept_list_.clear();
index 5a2ad58e2f182c6ac01ae686946d2f30f77e60ac..3b43bd607660edd77f47f1de23236881f1fd6cc9 100644 (file)
@@ -624,7 +624,7 @@ public:
         listener_->stop();
         listener2_->stop();
         listener3_->stop();
-        io_service_->getIOService().reset();
+        io_service_->restart();
         io_service_->poll();
         MultiThreadingMgr::instance().setMode(false);
     }
@@ -2072,7 +2072,7 @@ public:
         // Stop the IO service. This should cause the thread to terminate.
         io_service_->stop();
         thread->join();
-        io_service_->getIOService().reset();
+        io_service_->restart();
         io_service_->poll();
     }
 
@@ -2122,7 +2122,7 @@ public:
         // Stop the IO service. This should cause the thread to terminate.
         io_service_->stop();
         thread->join();
-        io_service_->getIOService().reset();
+        io_service_->restart();
         io_service_->poll();
     }
 
@@ -4693,7 +4693,7 @@ TEST_F(HAServiceTest, processMaintenanceStartSuccess) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner of our server is online and should have responded with
@@ -4745,7 +4745,7 @@ TEST_F(HAServiceTest, processMaintenanceStartSuccessAuthorized) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner of our server is online and should have responded with
@@ -4788,7 +4788,7 @@ TEST_F(HAServiceTest, processMaintenanceStartPartnerDown) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner of our server is online and should have responded with
@@ -4832,7 +4832,7 @@ TEST_F(HAServiceTest, processMaintenanceStartPartnerError) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     ASSERT_TRUE(rsp);
@@ -4874,7 +4874,7 @@ TEST_F(HAServiceTest, processMaintenanceStartPartnerUnauthorized) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     ASSERT_TRUE(rsp);
@@ -4917,7 +4917,7 @@ TEST_F(HAServiceTest, processMaintenanceStartNotAllowed) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     ASSERT_TRUE(rsp);
@@ -4961,7 +4961,7 @@ TEST_F(HAServiceTest, processMaintenanceCancelSuccess) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner of our server is online and should have responded with
@@ -5012,7 +5012,7 @@ TEST_F(HAServiceTest, processMaintenanceCancelSuccessAuthorized) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner of our server is online and should have responded with
@@ -5055,7 +5055,7 @@ TEST_F(HAServiceTest, processMaintenanceCancelPartnerError) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner should have responded with an error.
@@ -5101,7 +5101,7 @@ TEST_F(HAServiceTest, processMaintenanceCancelPartnerUnauthorized) {
     // Stop the IO service. This should cause the thread to terminate.
     io_service_->stop();
     thread->join();
-    io_service_->getIOService().reset();
+    io_service_->restart();
     io_service_->poll();
 
     // The partner should have responded with an error.
index c95bb94df0b0d243e900cb4aa951c569d1ca56e2..51dd70ca0eafcd6465ee23854eb2b13102eda929 100644 (file)
@@ -71,7 +71,7 @@ HATest::startHAService() {
 
 void
 HATest::runIOService(long ms) {
-    io_service_->getIOService().reset();
+    io_service_->restart();
     IntervalTimer timer(*io_service_);
     timer.setup(std::bind(&IOService::stop, io_service_), ms,
                 IntervalTimer::ONE_SHOT);
@@ -81,7 +81,7 @@ HATest::runIOService(long ms) {
 
 void
 HATest::runIOService(long ms, std::function<bool()> stop_condition) {
-    io_service_->getIOService().reset();
+    io_service_->restart();
     IntervalTimer timer(*io_service_);
     bool timeout = false;
     timer.setup(std::bind(&HATest::stopIOServiceHandler, this, std::ref(timeout)),
@@ -96,7 +96,7 @@ HATest::runIOService(long ms, std::function<bool()> stop_condition) {
 
 boost::shared_ptr<std::thread>
 HATest::runIOServiceInThread() {
-    io_service_->getIOService().reset();
+    io_service_->restart();
 
     bool running = false;
     std::mutex mutex;
index 239e282a4fc90026da83df16108c674bfbdf985d..dd6632ffdd6d74390fef6681227dee98179060fd 100644 (file)
@@ -123,7 +123,7 @@ struct IOFetchData {
         msgbuf(new OutputBuffer(512)),
         received(buff),
         callback(cb),
-        timer(service.getIOService()),
+        timer(service.getInternalIOService()),
         protocol(proto),
         cumulative(0),
         expected(0),
index a06be0e11cb77765c82b03c7ab54762a9a923ac3..6529c356ba014e435e0921571e3036786f147a41 100644 (file)
@@ -101,7 +101,7 @@ public:
                                         // Timeout interval chosen to ensure no timeout
         protocol_(IOFetch::TCP),        // for initialization - will be changed
         cumulative_(0),
-        timer_(service_.getIOService()),
+        timer_(service_.getInternalIOService()),
         receive_buffer_(),
         expected_buffer_(new OutputBuffer(512)),
         send_buffer_(),
@@ -474,12 +474,11 @@ public:
         expected_ = IOFetch::STOPPED;
 
         // Post the query
-        service_.getIOService().post(fetch);
+        service_.post(fetch);
 
         // Post query_.stop() (yes, the std::bind thing is just
         // query_.stop()).
-        service_.getIOService().post(
-            std::bind(&IOFetch::stop, fetch, IOFetch::STOPPED));
+        service_.post(std::bind(&IOFetch::stop, fetch, IOFetch::STOPPED));
 
         // Run both of them.  run() returns when everything in the I/O service
         // queue has completed.
@@ -501,7 +500,7 @@ public:
 
         // Stop before it is started
         fetch.stop();
-        service_.getIOService().post(fetch);
+        service_.post(fetch);
 
         service_.run();
         EXPECT_TRUE(run_);
@@ -517,7 +516,7 @@ public:
         protocol_ = protocol;
         expected_ = IOFetch::TIME_OUT;
 
-        service_.getIOService().post(fetch);
+        service_.post(fetch);
         service_.run();
         EXPECT_TRUE(run_);
     }
@@ -543,17 +542,17 @@ public:
         }
 
         // Socket into which the connection will be accepted.
-        tcp::socket socket(service_.getIOService());
+        tcp::socket socket(service_.getInternalIOService());
 
         // Acceptor object - called when the connection is made, the handler
         // will initiate a read on the socket.
-        tcp::acceptor acceptor(service_.getIOService(),
+        tcp::acceptor acceptor(service_.getInternalIOService(),
                                tcp::endpoint(tcp::v4(), TEST_PORT));
         acceptor.async_accept(socket,
             std::bind(&IOFetchTest::tcpAcceptHandler, this, &socket, ph::_1));
 
         // Post the TCP fetch object to send the query and receive the response.
-        service_.getIOService().post(tcp_fetch_);
+        service_.post(tcp_fetch_);
 
         // ... and execute all the callbacks.  This exits when the fetch
         // completes.
@@ -575,7 +574,7 @@ public:
         protocol_ = IOFetch::UDP;
 
         // Set up the server.
-        udp::socket socket(service_.getIOService(), udp::v4());
+        udp::socket socket(service_.getInternalIOService(), udp::v4());
         socket.set_option(socket_base::reuse_address(true));
         socket.bind(udp::endpoint(TEST_HOST, TEST_PORT));
         return_data_ = "Message returned to the client";
@@ -587,7 +586,7 @@ public:
                                   std::bind(&IOFetchTest::udpReceiveHandler,
                                             this, &remote, &socket,
                                             ph::_1, ph::_2, bad_qid, second_send));
-        service_.getIOService().post(udp_fetch_);
+        service_.post(udp_fetch_);
         if (debug_) {
             cout << "udpSendReceive: async_receive_from posted,"
                 "waiting for callback" << endl;
index 2d83e6350b01faf1a87050cd617bc045b2acb396..72aafe3f796cbf664a609df2cff5b03bd07e4c21 100644 (file)
@@ -102,7 +102,7 @@ private:
 };
 
 IntervalTimerImpl::IntervalTimerImpl(IOService& io_service) :
-    interval_(0), timer_(io_service.getIOService()),
+    interval_(0), timer_(io_service.getInternalIOService()),
     mode_(IntervalTimer::REPEATING) {
 }
 
index c7b53b2ed9de538ec713838126759bc8b4b18caa..d08bf39d9b469c3d0df0794ecfc21f44eba44642 100644 (file)
@@ -39,7 +39,7 @@ public:
     /// @param io_service Reference to the IO service.
     explicit IOAcceptor(IOService& io_service)
         : IOSocket(),
-          acceptor_(new typename ProtocolType::acceptor(io_service.getIOService())) {
+          acceptor_(new typename ProtocolType::acceptor(io_service.getInternalIOService())) {
     }
 
     /// @brief Destructor.
index f0d4662eb1b2c03442f06adb92537c6e36c7ea07..d0204df3082ff403371f4cf8944e6c2f9fd0707f 100644 (file)
@@ -45,16 +45,30 @@ public:
     /// This method return control to the caller as soon as the
     /// first handler has completed.  (If no handlers are ready when
     /// it is run, it will block until one is.)
-    void runOne() {
-        io_service_.run_one();
+    ///
+    /// \return The number of handlers that were executed.
+    size_t runOne() {
+        return (static_cast<size_t>(io_service_.run_one()));
     };
 
     /// \brief Run the underlying event loop for a ready events.
     ///
     /// This method executes handlers for all ready events and returns.
     /// It will return immediately if there are no ready events.
-    void poll() {
-        io_service_.poll();
+    ///
+    /// \return The number of handlers that were executed.
+    size_t poll() {
+        return (static_cast<size_t>(io_service_.poll()));
+    };
+
+    /// \brief Run the underlying event loop for a ready events.
+    ///
+    /// This method executes handlers for all ready events and returns.
+    /// It will return immediately if there are no ready events.
+    ///
+    /// \return The number of handlers that were executed.
+    size_t pollOne() {
+        return (static_cast<size_t>(io_service_.poll_one()));
     };
 
     /// \brief Stop the underlying event loop.
@@ -88,7 +102,7 @@ public:
     /// that share the same \c io_service with the authoritative server.
     /// It will eventually be removed once the wrapper interface is
     /// generalized.
-    boost::asio::io_service& getIOService() {
+    boost::asio::io_service& getInternalIOService() {
         return (io_service_);
     }
 
@@ -115,14 +129,19 @@ IOService::run() {
     io_impl_->run();
 }
 
-void
+size_t
 IOService::runOne() {
-    io_impl_->runOne();
+    return (io_impl_->runOne());
 }
 
-void
+size_t
 IOService::poll() {
-    io_impl_->poll();
+    return (io_impl_->poll());
+}
+
+size_t
+IOService::pollOne() {
+    return (io_impl_->pollOne());
 }
 
 void
@@ -146,8 +165,8 @@ IOService::stopWork() {
 }
 
 boost::asio::io_service&
-IOService::getIOService() {
-    return (io_impl_->getIOService());
+IOService::getInternalIOService() {
+    return (io_impl_->getInternalIOService());
 }
 
 void
index ca0b343778d30b8da7f16086aa00f57935859f49..100099f7f1977671af4c2621d693c645ff72c797 100644 (file)
@@ -58,13 +58,25 @@ public:
     /// This method return control to the caller as soon as the
     /// first handler has completed.  (If no handlers are ready when
     /// it is run, it will block until one is.)
-    void runOne();
+    ///
+    /// \return The number of handlers that were executed.
+    size_t runOne();
+
+    /// \brief Run the underlying event loop for a ready events.
+    ///
+    /// This method executes handlers for all ready events and returns.
+    /// It will return immediately if there are no ready events.
+    ///
+    /// \return The number of handlers that were executed.
+    size_t poll();
 
     /// \brief Run the underlying event loop for a ready events.
     ///
     /// This method executes handlers for all ready events and returns.
     /// It will return immediately if there are no ready events.
-    void poll();
+    ///
+    /// \return The number of handlers that were executed.
+    size_t pollOne();
 
     /// \brief Stop the underlying event loop.
     ///
@@ -89,7 +101,7 @@ public:
     /// that share the same \c io_service with the authoritative server.
     /// It will eventually be removed once the wrapper interface is
     /// generalized.
-    boost::asio::io_service& getIOService();
+    boost::asio::io_service& getInternalIOService();
 
     /// \brief Post a callback to the end of the queue.
     ///
index b844902f4e9fe8caf0b141721db9542eb75b7f5c..c498702324de8193e2d0cc5b1c77a18913c747df 100644 (file)
@@ -68,7 +68,7 @@ private:
 IOSignalSetImpl::IOSignalSetImpl(IOServicePtr io_service,
                                  IOSignalHandler handler)
     : io_service_(io_service),
-      signal_set_(io_service_->getIOService()),
+      signal_set_(io_service_->getInternalIOService()),
       handler_(handler) {
 }
 
index 69f3da2b533557145bd8361b8c310d1ed59acb0e..a558fd1044c54ab407da8e4140161e8fcebecbc7 100644 (file)
@@ -118,7 +118,7 @@ typedef boost::asio::ssl::stream<boost::asio::ip::tcp::socket> TlsStreamImpl;
 template <typename Callback, typename TlsStreamImpl>
 TlsStreamBase<Callback, TlsStreamImpl>::
 TlsStreamBase(IOService& service, TlsContextPtr context)
-    : TlsStreamImpl(service.getIOService(), context->getContext()),
+    : TlsStreamImpl(service.getInternalIOService(), context->getContext()),
       role_(context->getRole()) {
 }
 
index 8c8515be64d826986f1ce247f849f516fcab1403..40a53bec968dede77b6b6384138b616f430ab3eb 100644 (file)
@@ -262,7 +262,7 @@ TCPSocket<C>::TCPSocket(boost::asio::ip::tcp::socket& socket) :
 
 template <typename C>
 TCPSocket<C>::TCPSocket(IOService& service) :
-    socket_ptr_(new boost::asio::ip::tcp::socket(service.getIOService())),
+    socket_ptr_(new boost::asio::ip::tcp::socket(service.getInternalIOService())),
     socket_(*socket_ptr_)
 {
 }
index d4d13ee893a123caf47682d0e20ab0db64213810..c875b06a667ff5785309128afe7dc5c5fbd86ca4 100644 (file)
@@ -314,7 +314,7 @@ TEST_F(IntervalTimerTest, intervalModeTest) {
     // we've hit our goals.  It won't return zero unless is out of
     // work or the service has been stopped by the test timer.
     int cnt = 0;
-    while (((cnt = io_service_.getIOService().run_one()) > 0) && (repeater_count < 5)) {
+    while (((cnt = io_service_.runOne()) > 0) && (repeater_count < 5)) {
         // deliberately empty
     };
 
@@ -363,7 +363,7 @@ TEST_F(IntervalTimerTest, timerReuseTest) {
     // we've hit our goals.  It won't return zero unless is out of
     // work or the service has been stopped by the test timer.
     int cnt = 0;
-    while ((cnt = io_service_.getIOService().run_one()) && (one_shot_count < 4)) {
+    while ((cnt = io_service_.runOne()) && (one_shot_count < 4)) {
         // deliberately empty
     };
 
index 57fd4467c2da57335fd86b3292cdb20b99697457..8a4ed06656da3e44c7a0a9b64653483c163595d0 100644 (file)
@@ -65,7 +65,7 @@ public:
     ///
     /// @param io_service IO service to be stopped on error.
     explicit TCPClient(IOService& io_service)
-        : io_service_(io_service.getIOService()), socket_(io_service_) {
+        : io_service_(io_service.getInternalIOService()), socket_(io_service_) {
     }
 
     /// @brief Destructor.
index f78ac5f02651bc2fd1ee03a031489bcdd0728834..370d71d45514ad00c44dd4f729b031598e67d538 100644 (file)
@@ -324,7 +324,7 @@ TEST(TCPSocket, sequenceTest) {
     TCPEndpoint server_endpoint(server_address, SERVER_PORT);
                                             // Endpoint describing server
     TCPEndpoint server_remote_endpoint;     // Address where server received message from
-    tcp::socket server_socket(service.getIOService());
+    tcp::socket server_socket(service.getInternalIOService());
                                             // Socket used for server
 
     // Step 1.  Create the connection between the client and the server.  Set
@@ -335,7 +335,7 @@ TEST(TCPSocket, sequenceTest) {
     server_cb.queued() = TCPCallback::ACCEPT;
     server_cb.called() = TCPCallback::NONE;
     server_cb.setCode(42);  // Some error
-    tcp::acceptor acceptor(service.getIOService(),
+    tcp::acceptor acceptor(service.getInternalIOService(),
                             tcp::endpoint(tcp::v4(), SERVER_PORT));
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     acceptor.async_accept(server_socket, server_cb);
index b2716a829a368d8a0ed1344aaf92b8f14a3c5b4b..f7e65e48791dfa40cda598627118c07f75b4fe9d 100644 (file)
@@ -66,7 +66,7 @@ public:
     ///
     /// @param io_service IO service to be stopped on error.
     explicit TLSClient(IOService& io_service)
-        : io_service_(io_service.getIOService()), socket_(io_service_) {
+        : io_service_(io_service.getInternalIOService()), socket_(io_service_) {
     }
 
     /// @brief Destructor.
index 2804be3a736dcc3718135c6b2716448acc7737dc..0c81ec76262a661fc0435656b6095ce9f071d323 100644 (file)
@@ -344,7 +344,7 @@ TEST(TLSSocket, sequenceTest) {
     TlsContextPtr server_ctx;
     test::configServer(server_ctx);
     // Stream used for server.
-    TlsStreamImpl server(service.getIOService(), server_ctx->getContext());
+    TlsStreamImpl server(service.getInternalIOService(), server_ctx->getContext());
 
     // Step 1.  Create the connection between the client and the server.  Set
     // up the server to accept incoming connections and have the client open
@@ -354,7 +354,7 @@ TEST(TLSSocket, sequenceTest) {
     server_cb.queued() = TLSCallback::ACCEPT;
     server_cb.called() = TLSCallback::NONE;
     server_cb.setCode(42);  // Some error
-    tcp::acceptor acceptor(service.getIOService(),
+    tcp::acceptor acceptor(service.getInternalIOService(),
                            tcp::endpoint(tcp::v4(), SERVER_PORT));
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     acceptor.async_accept(server.lowest_layer(), server_cb);
index 5f10e64e5aad344dbf78ef21e2a521bb43a00b88..1b792091bc49c1b9936f3e089af707b6ce9702a9 100644 (file)
@@ -634,6 +634,7 @@ TEST(TLSTest, loadCertKeyFile) {
     exps.addThrow("PEM lib");
     exps.addThrow("PEM lib (SSL routines)");
     exps.addThrow("unsupported (DECODER routines)");
+    exps.addThrow("unsupported");
     // Another possible error.
     exps.addThrow("No such file or directory");
     exps.runCanThrow([] {
@@ -747,7 +748,7 @@ TEST(TLSTest, noHandshake) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -854,7 +855,7 @@ TEST(TLSTest, serverNotConfigured) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -953,7 +954,7 @@ TEST(TLSTest, clientNotConfigured) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1052,13 +1053,13 @@ TEST(TLSTest, clientHTTPnoS) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
 
     // Client part.
-    tcp::socket client(service.getIOService());
+    tcp::socket client(service.getInternalIOService());
 
     // Connect to.
     client.open(tcp::v4());
@@ -1147,13 +1148,13 @@ TEST(TLSTest, unknownClient) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
 
     // Client part.
-    tcp::socket client(service.getIOService());
+    tcp::socket client(service.getInternalIOService());
 
     // Connect to.
     client.open(tcp::v4());
@@ -1237,7 +1238,7 @@ TEST(TLSTest, anotherClient) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1338,7 +1339,7 @@ TEST(TLSTest, selfSigned) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1447,7 +1448,7 @@ TEST(TLSTest, noHandshakeCloseonError) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1550,7 +1551,7 @@ TEST(TLSTest, serverNotConfiguredCloseonError) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1648,7 +1649,7 @@ TEST(TLSTest, clientNotConfiguredCloseonError) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1746,13 +1747,13 @@ TEST(TLSTest, clientHTTPnoSCloseonError) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
 
     // Client part.
-    tcp::socket client(service.getIOService());
+    tcp::socket client(service.getInternalIOService());
 
     // Connect to.
     client.open(tcp::v4());
@@ -1841,7 +1842,7 @@ TEST(TLSTest, anotherClientCloseonError) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -1940,7 +1941,7 @@ TEST(TLSTest, selfSignedCloseonError) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2046,7 +2047,7 @@ TEST(TLSTest, anotherClientNoReq) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2118,7 +2119,7 @@ TEST(TLSTest, serverRaw) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2191,7 +2192,7 @@ TEST(TLSTest, trustedSelfSigned) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2269,7 +2270,7 @@ TEST(TLSTest, shutdownInactive) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2367,7 +2368,7 @@ TEST(TLSTest, shutdownActive) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2479,7 +2480,7 @@ TEST(TLSTest, shutdownCloseInactive) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
@@ -2583,7 +2584,7 @@ TEST(TLSTest, shutdownCloseActive) {
     // Accept a client.
     tcp::endpoint server_ep(tcp::endpoint(address::from_string(SERVER_ADDRESS),
                                           SERVER_PORT));
-    tcp::acceptor acceptor(service.getIOService(), server_ep);
+    tcp::acceptor acceptor(service.getInternalIOService(), server_ep);
     acceptor.set_option(tcp::acceptor::reuse_address(true));
     TestCallback accept_cb;
     acceptor.async_accept(server.lowest_layer(), accept_cb);
index da09ca203d9969cd90d37dc6d549e6557a7f9104..cc16d0ae1a8c60c865260f9a30e6ef6801ef7f9a 100644 (file)
@@ -230,7 +230,7 @@ TEST(UDPSocket, SequenceTest) {
     // The server - with which the client communicates.  For convenience, we
     // use the same io_service, and use the endpoint object created for
     // the client to send to as the endpoint object in the constructor.
-    boost::asio::ip::udp::socket server(service.getIOService(),
+    boost::asio::ip::udp::socket server(service.getInternalIOService(),
         server_endpoint.getASIOEndpoint());
     server.set_option(socket_base::reuse_address(true));
 
index fb282adc09aaa1f8583f37e18cbcb389027e5499..c0bd45ac5f21a50c49a793e20c49fc80f294437a 100644 (file)
@@ -160,7 +160,7 @@ public:
     /// @return Pointer to the socket.
     UnixSocketPtr getSocket() {
         if (!next_socket_) {
-            next_socket_.reset(new UnixSocket(io_service_.getIOService()));
+            next_socket_.reset(new UnixSocket(io_service_.getInternalIOService()));
         }
         return (next_socket_);
     }
@@ -228,7 +228,7 @@ TestServerUnixSocket::TestServerUnixSocket(IOService& io_service,
                                            const std::string& custom_response)
     : io_service_(io_service),
       server_endpoint_(socket_file_path),
-      server_acceptor_(io_service_.getIOService()),
+      server_acceptor_(io_service_.getInternalIOService()),
       test_timer_(io_service_),
       custom_response_(custom_response),
       connection_pool_(new ConnectionPool(io_service)),
index 75013e34f1b111525d572416e8caa0d3dc090c20..095ede45763fd79cb9cbeff5007381f2c3f7b6c5 100644 (file)
@@ -173,7 +173,7 @@ UDPSocket<C>::UDPSocket(boost::asio::ip::udp::socket& socket) :
 
 template <typename C>
 UDPSocket<C>::UDPSocket(IOService& service) :
-    socket_ptr_(new boost::asio::ip::udp::socket(service.getIOService())),
+    socket_ptr_(new boost::asio::ip::udp::socket(service.getInternalIOService())),
     socket_(*socket_ptr_), isopen_(false)
 {
 }
index 81c83955f656e364b308b92ca6d1977dcd5a949c..e5c3dd27ad29c352e53f52644181e98cbf73ad83 100644 (file)
@@ -26,7 +26,7 @@ public:
     ///
     /// @param io_service IO service to be used by the socket class.
     UnixDomainSocketImpl(IOService& io_service)
-        : socket_(io_service.getIOService()) {
+        : socket_(io_service.getInternalIOService()) {
     }
 
     /// @brief Destructor.
index 98517b7f9db6bf39d77eec946a98ce2aebf29cf7..76a02a037964bebaf2e51b7f6f4fb3c9d478bdfe 100644 (file)
@@ -392,7 +392,7 @@ public:
         // responses. The reuse address option is set so as both sockets can
         // use the same address. This new socket is bound to the test address
         // and port, where requests will be sent.
-        socket_.reset(new udp::socket(service_.getIOService(),
+        socket_.reset(new udp::socket(service_.getInternalIOService(),
                                       boost::asio::ip::udp::v4()));
         socket_->set_option(socket_base::reuse_address(true));
         socket_->bind(udp::endpoint(address::from_string(TEST_ADDRESS),
@@ -444,7 +444,7 @@ public:
         // Since the callback, operator(), calls stop() on the io_service,
         // we must reset it in order for subsequent calls to run() or
         // runOne() to work.
-        service_.getIOService().reset();
+        service_.restart();
     }
 
     /// @brief Performs a single request-response exchange with or without TSIG.
@@ -465,7 +465,7 @@ public:
         ASSERT_NO_THROW(message.setZone(Name("example.com"), RRClass::IN()));
 
         // Setup our "loopback" server.
-        udp::socket udp_socket(service_.getIOService(), boost::asio::ip::udp::v4());
+        udp::socket udp_socket(service_.getInternalIOService(), boost::asio::ip::udp::v4());
         udp_socket.set_option(socket_base::reuse_address(true));
         udp_socket.bind(udp::endpoint(address::from_string(TEST_ADDRESS),
                                       TEST_PORT));
@@ -496,7 +496,7 @@ public:
         // Since the callback, operator(), calls stop() on the io_service,
         // we must reset it in order for subsequent calls to run() or
         // runOne() to work.
-        service_.getIOService().reset();
+        service_.restart();
     }
 };
 
index 819a7d80b9042f5063b67729b4957734ee9bc8da..94cc2e61765e85e40a6031327c0650019813572b 100644 (file)
@@ -62,7 +62,7 @@ FauxServer::FauxServer(asiolink::IOService& io_service,
      server_socket_(), receive_pending_(false), perpetual_receive_(true),
      tsig_key_() {
 
-    server_socket_.reset(new boost::asio::ip::udp::socket(io_service_.getIOService(),
+    server_socket_.reset(new boost::asio::ip::udp::socket(io_service_.getInternalIOService(),
                                                    boost::asio::ip::udp::v4()));
     server_socket_->set_option(boost::asio::socket_base::reuse_address(true));
 
@@ -75,7 +75,7 @@ FauxServer::FauxServer(asiolink::IOService& io_service,
     :io_service_(io_service), address_(server.getIpAddress()),
      port_(server.getPort()), server_socket_(), receive_pending_(false),
      perpetual_receive_(true), tsig_key_() {
-    server_socket_.reset(new boost::asio::ip::udp::socket(io_service_.getIOService(),
+    server_socket_.reset(new boost::asio::ip::udp::socket(io_service_.getInternalIOService(),
                                                    boost::asio::ip::udp::v4()));
     server_socket_->set_option(boost::asio::socket_base::reuse_address(true));
     isc::asiolink::UDPEndpoint endpoint(address_, port_);
@@ -225,10 +225,10 @@ TimedIO::~TimedIO() {
 int
 TimedIO::runTimedIO(int run_time) {
     run_time_ = run_time;
-    int cnt = io_service_->getIOService().poll();
+    int cnt = io_service_->poll();
     if (cnt == 0) {
         timer_.setup(std::bind(&TimedIO::timesUp, this), run_time_);
-        cnt = io_service_->getIOService().run_one();
+        cnt = io_service_->runOne();
         timer_.cancel();
     }
 
index 6966b9e1009aa702a03ce149358ddf6be54b8116..8e9e9cf1151d375563108291bd26b0281f2258fa 100644 (file)
@@ -490,9 +490,7 @@ NameChangeSender::runReadyIO() {
 
     // We shouldn't be here if IO isn't ready to execute.
     // By running poll we're guaranteed not to hang.
-    /// @todo Trac# 3325 requests that asiolink::IOService provide a
-    /// wrapper for poll().
-    io_service_->getIOService().poll_one();
+    io_service_->pollOne();
 }
 
 }  // namespace dhcp_ddns
index 59a57d0d0da3c4b00d7786dc5447969bad0d0083..c46307e6570b8f04f06e4dd2333af33048f7d255 100644 (file)
@@ -93,7 +93,7 @@ NameChangeUDPListener::open(isc::asiolink::IOService& io_service) {
     // Create the low level socket.
     try {
         asio_socket_.reset(new boost::asio::ip::udp::
-                           socket(io_service.getIOService(),
+                           socket(io_service.getInternalIOService(),
                                   (ip_address_.isV4() ? boost::asio::ip::udp::v4() :
                                    boost::asio::ip::udp::v6())));
 
@@ -233,7 +233,7 @@ NameChangeUDPSender::open(isc::asiolink::IOService& io_service) {
     // Create the low level socket.
     try {
         asio_socket_.reset(new boost::asio::ip::udp::
-                           socket(io_service.getIOService(),
+                           socket(io_service.getInternalIOService(),
                                   (ip_address_.isV4() ? boost::asio::ip::udp::v4() :
                                    boost::asio::ip::udp::v6())));
 
index 2e46dac70d12fda7b749240823ecb82972870ec2..758689b835ac443c2b7aacd722d8849a6018de75 100644 (file)
@@ -197,7 +197,7 @@ public:
 
         // Create a UDP socket through which our "sender" will send the NCR.
         boost::asio::ip::udp::socket
-            udp_socket(io_service_.getIOService(), boost::asio::ip::udp::v4());
+            udp_socket(io_service_.getInternalIOService(), boost::asio::ip::udp::v4());
 
         // Create an endpoint pointed at the listener.
         boost::asio::ip::udp::endpoint
index 39c795b4f31bd41c052e5230842f507bd816f197..ee5b3a76d8e541bd4e302ee5c039807bdb644e25 100644 (file)
@@ -328,7 +328,7 @@ public:
         }, timeout_ms, IntervalTimer::ONE_SHOT);
 
         io_service_->run();
-        io_service_->getIOService().reset();
+        io_service_->restart();
     }
 
     /// @brief Setup timers according to the configuration and run them
index 139538d3970bba4d768138bde328ebfd6bcf9f24..5b10f964e39cbb54e8d8f829398dea87d18ea4a1 100644 (file)
@@ -122,7 +122,7 @@ CfgIfaceTest::doWait(const long timeout) {
         io_service_->stop();
     }, timeout, asiolink::IntervalTimer::ONE_SHOT);
     io_service_->run();
-    io_service_->getIOService().reset();
+    io_service_->restart();
 }
 
 // This test checks that the interface names can be explicitly selected
index 6e8612518c2382073b391549d35036e7aeec6467..85614f5badf4df7c51862a9b5588daba9fa7d503 100644 (file)
@@ -248,7 +248,7 @@ public:
         }, ms, IntervalTimer::ONE_SHOT);
 
         io_service_->run();
-        io_service_->getIOService().reset();
+        io_service_->restart();
     }
 
     /// @brief Waits for the specified process to finish.
@@ -275,7 +275,7 @@ public:
         }, 1, IntervalTimer::REPEATING);
 
         io_service_->run();
-        io_service_->getIOService().reset();
+        io_service_->restart();
         return (!elapsed);
     }
 
index 9ec62104dc6c7a520eae15b5815bbd78c94fece6..d1eba3364337786f4638c6fc224cbcbfe78e5ee4 100644 (file)
@@ -170,7 +170,7 @@ TimerMgrTest::doWait(const long timeout, const bool /*call_receive*/) {
         io_service_->stop();
     }, timeout, IntervalTimer::ONE_SHOT);
     io_service_->run();
-    io_service_->getIOService().reset();
+    io_service_->restart();
 }
 
 void
index b8f9ac5cb91bf3fa20d0622720fbdc8ee1eb22fc..517d1c8ce9a65b09a7b6c4fe4b7d5f6c08c0c4c2 100644 (file)
@@ -444,7 +444,7 @@ public:
     /// @param timeout Optional value specifying for how long the io service
     /// should be ran.
     void runIOService(long timeout = 0) {
-        io_service_.getIOService().reset();
+        io_service_.restart();
 
         if (timeout > 0) {
             run_io_service_timer_.setup(std::bind(&HttpListenerTest::timeoutHandler,
@@ -452,7 +452,7 @@ public:
                                         timeout, IntervalTimer::ONE_SHOT);
         }
         io_service_.run();
-        io_service_.getIOService().reset();
+        io_service_.restart();
         io_service_.poll();
     }
 
@@ -939,7 +939,7 @@ TEST_F(HttpListenerTest, invalidIdleTimeout) {
 // This test verifies that listener can't be bound to the port to which
 // other server is bound.
 TEST_F(HttpListenerTest, addressInUse) {
-    tcp::acceptor acceptor(io_service_.getIOService());
+    tcp::acceptor acceptor(io_service_.getInternalIOService());
     // Use other port than SERVER_PORT to make sure that this TCP connection
     // doesn't affect subsequent tests.
     tcp::endpoint endpoint(address::from_string(SERVER_ADDRESS),
index 50078bdd8000eb8091f7cbfd02d34c51487d37e8..3b164756f14d84cc711c5089bb16b917bcf55fd3 100644 (file)
@@ -34,7 +34,7 @@ public:
     explicit TestHttpClient(IOService& io_service,
                             const std::string& server_address = "127.0.0.1",
                             uint16_t port = 18123)
-        : io_service_(io_service.getIOService()), socket_(io_service_),
+        : io_service_(io_service.getInternalIOService()), socket_(io_service_),
           buf_(), response_(), server_address_(server_address),
           server_port_(port), receive_done_(false) {
     }
index 45b348abf2525ba049876783dcbc203af4d5d7ac..88742144216648abc22dec6ac974c1a082b7b63a 100644 (file)
@@ -250,7 +250,7 @@ public:
     /// @param timeout Optional value specifying for how long the io service
     /// should be ran (ms).
     void runIOService(long timeout = 0) {
-        io_service_.getIOService().reset();
+        io_service_.restart();
 
         if (timeout > 0) {
             run_io_service_timer_.setup(std::bind(&HttpListenerTest::timeoutHandler,
@@ -258,7 +258,7 @@ public:
                                         timeout, IntervalTimer::ONE_SHOT);
         }
         io_service_.run();
-        io_service_.getIOService().reset();
+        io_service_.restart();
         io_service_.poll();
     }
 
index 0d5a940e0240d2f38c987377eb0dc03997701060..3f41eb1ca3e643738156013ee0a63a9e5fe302ab 100644 (file)
@@ -407,7 +407,7 @@ public:
     /// @param io_service IO service to be stopped on error.
     /// @param tls_context TLS context.
     TestHttpClient(IOService& io_service, TlsContextPtr tls_context)
-        : io_service_(io_service.getIOService()),
+        : io_service_(io_service.getInternalIOService()),
           stream_(io_service_, tls_context->getContext()),
           buf_(), response_() {
     }
@@ -693,7 +693,7 @@ public:
     /// @param timeout Optional value specifying for how long the io service
     /// should be ran.
     void runIOService(long timeout = 0) {
-        io_service_.getIOService().reset();
+        io_service_.restart();
 
         if (timeout > 0) {
             run_io_service_timer_.setup(std::bind(&HttpsListenerTest::timeoutHandler,
@@ -701,7 +701,7 @@ public:
                                         timeout, IntervalTimer::ONE_SHOT);
         }
         io_service_.run();
-        io_service_.getIOService().reset();
+        io_service_.restart();
         io_service_.poll();
     }
 
@@ -1194,7 +1194,7 @@ TEST_F(HttpsListenerTest, invalidIdleTimeout) {
 // This test verifies that listener can't be bound to the port to which
 // other server is bound.
 TEST_F(HttpsListenerTest, addressInUse) {
-    tcp::acceptor acceptor(io_service_.getIOService());
+    tcp::acceptor acceptor(io_service_.getInternalIOService());
     // Use other port than SERVER_PORT to make sure that this TCP connection
     // doesn't affect subsequent tests.
     tcp::endpoint endpoint(address::from_string(SERVER_ADDRESS),
index 26f371fb8ec8dcceffd3bb4b8a1bd9017a729ac2..9b8f65edc494672686014c1d12ab9f3e2baf7eab 100644 (file)
@@ -842,7 +842,6 @@ DControllerBase::~DControllerBase() {
     } catch (...) {
         // Don't want to throw exceptions from the destructor. The process
         // is shutting down anyway.
-        ;
     }
 }
 
index 0cb6e65c53f2a14950cabee4dc32d0ccd2841d83..31b611ba9f908ab53fb27384b41437ac456d47ef 100644 (file)
@@ -150,7 +150,7 @@ public:
     /// @param timeout Optional value specifying for how long the io service
     /// should be ran.
     void runIOService(long timeout = 0) {
-        io_service_.getIOService().reset();
+        io_service_.restart();
 
         if (timeout > 0) {
             run_io_service_timer_.setup(std::bind(&TcpListenerTest::timeoutHandler,
@@ -159,7 +159,7 @@ public:
                                         IntervalTimer::ONE_SHOT);
         }
         io_service_.run();
-        io_service_.getIOService().reset();
+        io_service_.restart();
         io_service_.poll();
     }
 
index 5d14c65bfdd780990cc9e382efc3419563069d4a..f58e3873c310a020dd9a077f16dd22cbbcd85de2 100644 (file)
@@ -83,7 +83,7 @@ public:
                                 isc::asiolink::TlsContextPtr(),
                            const std::string& server_address = "127.0.0.1",
                            uint16_t port = 18123)
-        : io_service_(io_service.getIOService()),
+        : io_service_(io_service.getInternalIOService()),
           tls_context_(tls_context),
           tcp_socket_(), tls_socket_(),
           done_callback_(done_callback),
index 8fdc416099e92f3807a1f8690fffa94231753f07..9d3fbdb8203a51cb63b8789303cef8305824bee3 100644 (file)
@@ -160,7 +160,7 @@ public:
     /// @param timeout Optional value specifying for how long the io service
     /// should be ran.
     void runIOService(long timeout = 0) {
-        io_service_.getIOService().reset();
+        io_service_.restart();
 
         if (timeout > 0) {
             run_io_service_timer_.setup(std::bind(&TlsListenerTest::timeoutHandler,
@@ -169,7 +169,7 @@ public:
                                         IntervalTimer::ONE_SHOT);
         }
         io_service_.run();
-        io_service_.getIOService().reset();
+        io_service_.restart();
         io_service_.poll();
     }