// Let's process incoming data or expiring timers in a loop until
// shutdown condition is detected.
while (!shouldShutdown()) {
- getIoService()->get_io_service().poll();
+ runIO();
}
stopIOService();
} catch (const std::exception& ex) {
LOG_DEBUG(netconf_logger, isc::log::DBGLVL_START_SHUT, NETCONF_RUN_EXIT);
}
+size_t
+NetconfProcess::runIO() {
+ size_t cnt = getIoService()->get_io_service().poll();
+ if (!cnt) {
+ cnt = getIoService()->get_io_service().run_one();
+ }
+ return (cnt);
+}
+
isc::data::ConstElementPtr
NetconfProcess::shutdown(isc::data::ConstElementPtr /*args*/) {
setShutdownFlag(true);
/// @brief Returns a pointer to the configuration manager.
NetconfCfgMgrPtr getNetconfCfgMgr();
+
+private:
+
+ /// @brief Polls all ready handlers and then runs one handler if none
+ /// handlers have been executed as a result of polling.
+ ///
+ /// @return Number of executed handlers.
+ size_t runIO();
};
/// @brief Defines a shared pointer to NetconfProcess.