Пример #1
0
 protected override void OnStart(string[] args)
 {
     try
     {
         //初始化配置项字典
         ConfigHelper.Init(ConfigScope.GPSGatewayBusinessWS.ToString(), System.Configuration.ConfigurationSettings.AppSettings["CaseType"]);
         string ip = Common.GetLocalIP();
         int port = int.Parse(ConfigHelper.GetConfig("localport"));
         string alarmip = ConfigHelper.GetConfig("alarmServerIP");
         int alarmport = int.Parse(ConfigHelper.GetConfig("alarmServerPort"));
         server = new PES.GPSGateway.Business.Server(ip, port, alarmip, alarmport);
         server.Init();
         server.Start();
     }
     catch (Exception ex)
     {
         Logger.Error(ex, null);
     }
 }
Пример #2
0
        static void StartBusinessServer()
        {
            PES.GPSGateway.Business.Server server;
            string filePath = Thread.GetDomain().BaseDirectory;
            FileInfo fileInfo = new FileInfo(filePath + "\\Config\\Environment\\log4net.config");
            log4net.Config.XmlConfigurator.Configure(fileInfo);

            string ip = ConfigHelper.GetConfig("localip");
            int port = int.Parse(ConfigHelper.GetConfig("localport"));
            string alarmip = ConfigHelper.GetConfig("alarmServerIP");
            int alarmport = int.Parse(ConfigHelper.GetConfig("alarmServerPort"));
            server = new PES.GPSGateway.Business.Server(ip, port, alarmip, alarmport);
            server.Init();
            server.Start();
        }