/[projects]/smsdaemon/SmsDaemon.cpp
ViewVC logotype

Diff of /smsdaemon/SmsDaemon.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 205 by torben, Fri Dec 19 22:29:25 2008 UTC revision 675 by torben, Tue Apr 27 20:07:12 2010 UTC
# Line 18  Line 18 
18  #include "PluginManager.h"  #include "PluginManager.h"
19  #include "ConfigFile.h"  #include "ConfigFile.h"
20  #include "Logger.h"  #include "Logger.h"
21    #include "AccessManager.h"
22    #include "embedded-http/embeddedhttp.h"
23    
24  #include "version.h"  #include "version.h"
25    
26    
27  using namespace std;  using namespace std;
28    
29  void SmsDaemon::CreateLogMessage(SMS& sms,bool hasPlugin)  void SmsDaemon::CreateLogMessage(SMS& sms,bool hasPlugin)
# Line 77  void SmsDaemon::MainLoop() Line 80  void SmsDaemon::MainLoop()
80  {  {
81          Common* cmn = Common::instance();          Common* cmn = Common::instance();
82          volatile bool& mainContinue = cmn->mainContinue;          volatile bool& mainContinue = cmn->mainContinue;
83            volatile bool& reloadConfig = cmn->reloadConfig;
84    
85          mainContinue = true;          mainContinue = true;
86    
# Line 91  void SmsDaemon::MainLoop() Line 94  void SmsDaemon::MainLoop()
94                  if (cmn->isDebug && kbhit())                  if (cmn->isDebug && kbhit())
95                          break;                          break;
96    
97                    if (reloadConfig)
98                            ReloadConfig();
99    
100                  Util::Sleep(100);                  Util::Sleep(100);
101    
102          }          }
103  }  }
104    
105    void SmsDaemon::ReloadConfig()
106    {
107            Common* cmn = Common::instance();
108            cmn->reloadConfig = false;
109    
110            cmn->GetConfigfile()->Reload();
111    
112            cmn->GetPluginManager()->DestroyPlugins();
113            cmn->GetPluginManager()->LoadPlugins();
114    
115            cmn->GetTaskManager()->DestroyTasks();
116            cmn->GetTaskManager()->LoadTasks();
117    
118            AccessManager::Load(); //reload blaclist & privileged list
119    }
120    
121  void SmsDaemon::Start()  void SmsDaemon::Start()
122  {  {
123          Common* cmn = Common::instance();          Common* cmn = Common::instance();
# Line 111  void SmsDaemon::Start() Line 133  void SmsDaemon::Start()
133          Logger::logMessage( SVNVERSION );          Logger::logMessage( SVNVERSION );
134          Logger::logMessage( string("Transceiver: ") + transceiver );          Logger::logMessage( string("Transceiver: ") + transceiver );
135    
136            AccessManager::Load(); //reload blaclist & privileged list
137          cmn->GetTaskManager()->LoadTasks();          cmn->GetTaskManager()->LoadTasks();
138          cmn->GetPluginManager()->LoadPlugins();          cmn->GetPluginManager()->LoadPlugins();
139          Logger::logMessage("SMS daemon started");          Logger::logMessage("SMS daemon started");
140    
141          _modem.DeleteAllSms();          embeddedHttp = new EmbeddedHttp();
142            embeddedHttp->startServer();
143    
144          try          try
145          {          {
# Line 130  void SmsDaemon::Start() Line 154  void SmsDaemon::Start()
154                  Logger::logMessage( "Caught unknown exception" );                  Logger::logMessage( "Caught unknown exception" );
155          }          }
156    
157            embeddedHttp->stopServer();
158    
159          cmn->GetPluginManager()->DestroyPlugins();          cmn->GetPluginManager()->DestroyPlugins();
160    
161          Logger::logMessage( cmn->getStatusMessage() );          Logger::logMessage( cmn->getStatusMessage() );

Legend:
Removed from v.205  
changed lines
  Added in v.675

  ViewVC Help
Powered by ViewVC 1.1.20