Exemplo n.º 1
0
        /// <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()));
            }
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
 private void MainWindow_OnClosed(object sender, EventArgs e)
 {
     GSServer.SaveAllAppSettings();
 }