private FloorStatus() { try { _updateFloorStatusOld = Extensions.GetAppSettingValueBool("UpdateFloorStatusOld", false); if (_updateFloorStatusOld) { _oServer = IPCServer.GetInstance(ConfigManager.Read("RemotingServer"), Convert.ToInt32(ConfigManager.Read("RemotingServerPort"))); int itmpInterval = Convert.ToInt32(ConfigManager.Read("RemotingServerInterval")) * 1000; if (itmpInterval > 5000) { iInterval = itmpInterval; } mre_isStoped = new ManualResetEvent(false); Thread th = new Thread(UpdateFloorStatus); th.Start(); } else { _exec = ExecutorServiceFactory.CreateExecutorService(); CDOCentralServerHostApplication.Start(_exec); } } catch (Exception ex) { LogManager.WriteLog("FloorStatus : Unable to initialize the reference type." + ex.Message, LogManager.enumLogLevel.Error); } }
public void Stop() { try { if (_updateFloorStatusOld) { _oServer.StopServerSession(); mre_isStoped.Set(); } else { CDOCentralServerHostApplication.Stop(); } } catch { } LogManager.WriteLog("FloorStatus : Floor status updation is stopped", LogManager.enumLogLevel.Info); }