A class that represents the core Stumps server.
Inheritance: IDisposable
Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Stumps.StumpsService"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <exception cref="System.ArgumentNullException"><paramref name="configuration"/> is <c>null</c>.</exception>
        public StumpsService(StumpsConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            InitializeComponent();
            _server = new StumpsRunner(configuration);
        }
Esempio n. 2
0
        /// <summary>
        ///     Runs the instance of the Stumps server.
        /// </summary>
        public void RunInstance()
        {
            this.MessageWriter.Information(StartupResources.StartupStarting);

            using (var server = new StumpsRunner(this.Configuration))
            {
                server.Start();
                this.MessageWriter.Information(StartupResources.StartupComplete);

                Console.ReadLine();

                this.MessageWriter.Information(StartupResources.ShutdownStarting);
                server.Shutdown();
                this.MessageWriter.Information(StartupResources.ShutdownComplete);
            }
        }