WIP, some workaround around the service manager, to be cleaned seriously later

This commit is contained in:
emeric
2014-06-25 17:30:32 +02:00
parent 16c77d56be
commit 95341dcb0a
6 changed files with 31 additions and 8 deletions
+14 -2
View File
@@ -18,6 +18,11 @@ ServiceManager::ServiceManager()
_signalSet.add(SIGHUP);
}
ServiceManager::~ServiceManager()
{
stopServices();
}
void
ServiceManager::run()
{
@@ -25,8 +30,15 @@ ServiceManager::run()
asyncWaitSignals();
std::cout << "ServiceManager::run Waiting for events..." << std::endl;
// Wait for events
_ioService.run();
try {
// Wait for events
_ioService.run();
}
catch( std::exception& e )
{
std::cerr << "Caugh exception in service : " << e.what() << std::endl;
stopServices();
}
std::cout << "ServiceManager::run complete!" << std::endl;
}