Пример #1
0
        protected override void OnStart(string[] args)
        {
            string config     = Path.GetDirectoryName(typeof(Service1).Assembly.Location) + "\\log4net.config";
            var    repository = new FileInfo(config);

            XmlConfigurator.Configure(repository);
            ILog log  = LogManager.GetLogger(typeof(Service1));
            var  port = InitPort(log);

            reactor.Accept(port, new IPEndPoint(IPAddress.Any, port));

            InitI8583Initializer();

            _host = new ServiceHost(typeof(WebCacheService));
            _host.Open();
            log.Info("WebCacheService started");


            _host2 = new ServiceHost(typeof(EcardOnlineService));
            _host2.Open();
            log.Info("EcardOnlineService started");
        }