Beispiel #1
0
        /// <summary>
        /// The real entry point of program
        /// </summary>
        public static void Load(Action<UserConfiguration> register)
        {
            if (IsReboot)
            {
                if (!PlatformCompact.Checkout())
                {
                    return;
                }

                IsReboot = true;
            }
            else
            {
                Release();
            }

            // Load the configuration and booting the server.
            UserConfiguration config = new ConfigurationLoader().Load();

            Session.Init(config.SessionLifetime);

            IDispatcher dispatcher = new DispatcherImpl();
            dispatcher.SetCacheDriver(new FileSystemCacheDriver());

            courseServer = new Server(config.ServerInfo);
            courseServer.AddHandleListener(dispatcher.Handle);

            register(config);

            courseServer.Start();
        }
Beispiel #2
0
 public SlowDispatcher(Config config, IDispatcherPrerequisites prerequisites) : base(config, prerequisites)
 {
     _instance = new DispatcherImpl(this);
 }