Ejemplo n.º 1
0
        private static LoginServer CreateServer(ProgramConfiguration config, IPersistenceContextProvider persistenceContextProvider)
        {
            var loginServer       = LoginServerFactory.Create(config, persistenceContextProvider);
            var serviceController = ServiceControllerFactory.Create(config.RpcService, loginServer);

            loginServer.AddDependency(serviceController);
            return(loginServer);
        }
Ejemplo n.º 2
0
        /// <summary>The server entry point.</summary>
        public static void Main()
        {
            var repository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            log4net.Config.BasicConfigurator.Configure(repository);

            var config = new ProgramConfiguration();

            using (var persistenceContextProvider = new PersistenceContextProvider(config.PersistenceConfiguration))
                using (var server = CreateServer(config, persistenceContextProvider)) {
                    server.Start();
                    Task.WaitAny(server.ShutdownTask, InterruptSignal());
                    server.Stop();
                }
        }