/// <summary> /// Starts a specific server /// </summary> /// <param name="cfg">The configuration of the specific server to run</param> protected override void StartServer(ServerConfig cfg) { if (cfg.Name == ServerName) { Server = new GSServer(IPAddress.Parse(cfg.ListeningAddress), cfg.ListeningPort).Start(); Console.WriteLine( StringExtensions.FormatServerTableContext(cfg.Name, cfg.ListeningAddress, cfg.ListeningPort.ToString())); } }
protected ObjectBase() { var monitorItem = new MonitorEntry { Datetime = Principles.HiResDateTime.UtcNow, Device = MonitorDevice.Server, Category = MonitorCategory.Server, Type = MonitorType.Information, Method = MethodBase.GetCurrentMethod().Name, Thread = Thread.CurrentThread.ManagedThreadId, Message = "CountObject" }; MonitorLog.LogToMonitor(monitorItem); // We increment the global count of objects. GSServer.CountObject(); }
void IClassFactory.LockServer(bool bLock) { // // LocalSystem.TraceLogItem("LockServer", "Lock server: " + bLock); if (bLock) { GSServer.CountLock(); } else { // LocalServer.UncountLock(); // Always attempt to see if we need to shutdown this server application. // // LocalSystem.TraceLogItem("LockServer", "Calling ExitIf to check whether we can exit the server"); GSServer.ExitIf(); } }
private void MainWindow_OnClosed(object sender, EventArgs e) { GSServer.SaveAllAppSettings(); }