コード例 #1
0
ファイル: CoreService.cs プロジェクト: zhutoutou/APP
        public void Start()
        {
            //启动CallInServer
            try
            {
                CallInServer.ServerPort = SysParameters.CallInServerPort;
                CallInServer.ServerConnectedClientChanged += CallInServerConnectedClient_Changed;
                CallInServer.Start();
                LogHelper.WriteLog("CallInServer已启动");
            }
            catch (Exception ex)
            {
                LOG.LogHelper.WriteLog("", ex);
            }

            //启动CarLocationServer
            try
            {
                CarLocationServer.ServerPort = SysParameters.CarLocationServerPort;
                CarLocationServer.ServerConnectedClientChanged += CarLocationServerConnectedClient_Changed;
                CarLocationServer.Start();
                LogHelper.WriteLog("CarLocationServer已启动");
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("", ex);
            }

            //启动OtherMsgServer
            try
            {
                OtherMsgServer.ServerPort = SysParameters.OtherMsgServerPort;
                OtherMsgServer.ServerConnectedClientChanged += OtherMsgServerConnectedClient_Changed;
                OtherMsgServer.Start();
                LogHelper.WriteLog("OtherMsgServer已启动");
            }
            catch (Exception ex)
            {
                LOG.LogHelper.WriteLog("", ex);
            }

            //启动数据库连接检测线程
            CT.ConnectionStatusChanged += DBConnect_StatusChanged;
            CT.Start();
            LogHelper.WriteLog("数据库连接检测线程已启动");

            //启动CallInfo数据库析服务
            CI.Start();
            LogHelper.WriteLog("CallInfo数据分析服务已启动");

            //启动QualityComment数据分析服务
            QC.Start();
            LogHelper.WriteLog("QualityComment数据分析服务已启动");
        }
コード例 #2
0
ファイル: CoreService.cs プロジェクト: zhutoutou/APP
 /// <summary>
 /// 开始数据交换服务
 /// </summary>
 public void StartService()
 {
     try
     {
         //连接CallInServer
         CallInServer.ConnectionStatusChanged += CallInServer_StatusChanged;
         CallInServer.Start();
     }
     catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); }
     try
     {
         //连接OtherMsgServer
         OtherMsgServer.ConnectionStatusChanged += OtherMsgServer_StatusChanged;
         OtherMsgServer.Start();
     }
     catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); }
     try
     {
         //连接CarLocationServer
         CarLocationServer.ConnectionStatusChanged += CarLocationServer_StatusChanged;
         CarLocationServer.Start();
     }
     catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); }
     try
     {
         if (bs != null)
         {
             //UDP连接120业务服务器
             bs.ConnectionStatusChanged += BusnessServer_StatusChanged;
             bs.Start();
         }
     }
     catch (Exception ex) { LOG.LogHelper.WriteLog("UDP业务服务器启动失败", ex); }
     try
     {
         if (bsTcp != null)
         {
             //TCP连接120业务服务器
             bsTcp.ConnectionStatusChanged += BusnessServer_StatusChanged;
             bsTcp.Start();
         }
     }
     catch (Exception ex) { LOG.LogHelper.WriteLog("TCP业务服务器启动失败", ex); }
     try
     {
         if (gs != null)
         {
             //监听GPS业务器的广播车辆轨迹数据
             gs.Start();
         }
     }
     catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); }
 }