Example #1
0
        static void Main(string[] args)
        {
            Log.Initialize("BlazeServer.log", LogLevel.All);
            Log.Info("Starting Blaze server...");

            /* try
             * {
             *  Configuration.Load("config.yml");
             * }
             * catch (IOException)
             * {
             *  Log.Error(string.Format("Could not open the configuration file {0}.", "config.yml"));
             *  return;
             * } */

            // start BlazeHub (gosredirector) server
            BlazeHub.Start();

            // start Blaze server
            BlazeServer.Start();

            while (true)
            {
            }
        }
Example #2
0
        private async Task Start(string configFileName)
        {
            Log.Initialize("BlazeServer.log", LogLevel.All, true);
            Log.Info("Starting Blaze server...");

            try
            {
                Configuration.Load(configFileName ?? "config.yml");

                if (Configuration.DatabaseConfiguration == null)
                {
                    Log.Error("Database configuration was not found.");
                    return;
                }
            }
            catch (IOException)
            {
                Log.Error(string.Format("Could not open the configuration file {0}.", configFileName ?? "config.yml"));
                return;
            }

            Database.Initialize();
            ClientManager.Initialize();

            var blazeServer = new BlazeServer(10041);

            blazeServer.Start();

            var telemetryServer = new TelemetryServer(9988);

            telemetryServer.Start();

            var tickerServer = new TickerServer(8999);

            tickerServer.Start();

            /* new Thread(() =>
             * {
             *
             * }).Start(); */

            while (true)
            {
                try
                {
                    Log.WriteAway();

                    ClientManager.CleanClients();
                }
                catch (Exception e) { Log.Error(e.ToString()); }

                Thread.Sleep(5000);
            }
        }
Example #3
0
        private async Task Start(string configFileName)
        {
            Log.Initialize("BlazeServer.log", LogLevel.All, true);
            Log.Info("Starting Blaze server...");

            try
            {
                Configuration.Load(configFileName ?? "config.yml");

                if (Configuration.DatabaseConfiguration == null)
                {
                    Log.Error("Database configuration was not found.");
                    return;
                }
            }
            catch (IOException)
            {
                Log.Error(string.Format("Could not open the configuration file {0}.", configFileName ?? "config.yml"));
                return;
            }

            Database.Initialize();
            ClientManager.Initialize();

            var blazeServer = new BlazeServer(10041);
            blazeServer.Start();

            var telemetryServer = new TelemetryServer(9988);
            telemetryServer.Start();

            var tickerServer = new TickerServer(8999);
            tickerServer.Start();

            /* new Thread(() =>
            {

            }).Start(); */

            while (true)
            {
                try
                {
                    Log.WriteAway();

                    ClientManager.CleanClients();
                }
                catch (Exception e) { Log.Error(e.ToString()); }

                Thread.Sleep(5000);
            }
        }