protected override void OnStart(string[] args) { Base.StartUp(); try { try { Base.GarbageCollector.Start(); } catch { Log <RCServerService> .Logger.Error("Cannot start Auto garbage collector"); throw; } try { Base.ClientServer.Start(Base.ServerClientPort); } catch { Log <RCServerService> .Logger.ErrorFormat("Cannot start RC Clients' Server on Port {0}", Base.ServerClientPort); throw; } try { Base.ControlServer.Start(Base.ServerControlPort); } catch { Log <RCServerService> .Logger.ErrorFormat("Cannot start RCS control server on Port {0} ", Base.ServerControlPort); throw; } try { Base.PingSender.Start(); } catch { Log <RCServerService> .Logger.Error("Cannot start Ping sender"); throw; } } catch { Base.CleanUp(); throw; } }
protected override void OnStop() { Base.SaveConfig(BaseConfiguration.WorkingDirectory + "\\" + BaseConfiguration.ServerConfigFile); Base.CleanUp(); GC.Collect(); }