Пример #1
0
        public static void Main(string[] args)
        {
            XmlConfigurator.Configure();

            m_log.Info("Launching UserServer...");

            OpenUser_Main userserver = new OpenUser_Main();

            userserver.Startup();
            userserver.Work();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            ServicePointManager.DefaultConnectionLimit = 12;

            PIDFileManager pidFile = new PIDFileManager();

            XmlConfigurator.Configure();

            m_log.Info("Launching UserServer...");

            OpenUser_Main userserver = new OpenUser_Main();

            pidFile.SetStatus(PIDFileManager.Status.Starting);
            userserver.Startup();

            pidFile.SetStatus(PIDFileManager.Status.Running);
            userserver.Work();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            // Please note that if you are changing something in this function you should check to see if you need to change the other server's Main functions as well.

            // Under any circumstance other than an explicit exit the exit code should be 1.
            Environment.ExitCode = 1;

            ServicePointManager.DefaultConnectionLimit = 12;

            // Add the arguments supplied when running the application to the configuration
            var configSource = new ArgvConfigSource(args);

            configSource.Alias.AddAlias("On", true);
            configSource.Alias.AddAlias("Off", false);
            configSource.Alias.AddAlias("True", true);
            configSource.Alias.AddAlias("False", false);
            configSource.Alias.AddAlias("Yes", true);
            configSource.Alias.AddAlias("No", false);

            configSource.AddSwitch("Startup", "background");
            configSource.AddSwitch("Startup", "pidfile");

            m_log.Info("[SERVER]: Launching UserServer...");

            var pidFile = new PIDFileManager(configSource.Configs["Startup"].GetString("pidfile", string.Empty));

            XmlConfigurator.Configure();

            var userserver = new OpenUser_Main();

            pidFile.SetStatus(PIDFileManager.Status.Starting);
            userserver.Startup();

            pidFile.SetStatus(PIDFileManager.Status.Running);
            userserver.Work(configSource.Configs["Startup"].GetBoolean("background", false));
        }