15 #include <condition_variable> 24 BOOL CtrlHandler(DWORD fdwCtrlType)
30 case CTRL_CLOSE_EVENT:
31 case CTRL_BREAK_EVENT:
32 case CTRL_LOGOFF_EVENT:
33 case CTRL_SHUTDOWN_EVENT:
37 std::cout <<
"terminating.." << std::endl;
39 DaemonInstance =
nullptr;
61 if (!SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE))
63 std::cerr <<
"Cannot set terminate handler. Application may not response on exit event." << std::endl;
66 DaemonInstance =
this;
OPC UA Address space part. GNU LGPL.
void Daemonize(const std::string &str)
void SetTerminateHandlers()