Commit ad9f2d6b authored by Francis Dupont's avatar Francis Dupont

[128-netconf-use-libprocess] Adopted runIO() which of course will be extended

parent 446b43cc
......@@ -45,7 +45,7 @@ NetconfProcess::run() {
// 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) {
......@@ -62,6 +62,15 @@ NetconfProcess::run() {
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);
......
......@@ -84,6 +84,14 @@ public:
/// @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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment