/// <summary> /// 开始数据交换服务 /// </summary> public void StartService() { try { //UDP连接120业务服务器 gs.ConnectionStatusChanged += BusnessServer_StatusChanged; gs.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("UDP业务服务器启动失败", ex); } //启动数据库连接检测线程 CTL.ConnectionStatusChanged += DBLConnect_StatusChanged; CTL.Start(); LogHelper.WriteLog("本地数据库连接检测线程已启动"); //启动数据库连接检测线程 CTR.ConnectionStatusChanged += DBRConnect_StatusChanged; CTR.Start(); LogHelper.WriteLog("对方数据库连接检测线程已启动"); //启动SendNewInfo数据库析服务 SN.Start(); LogHelper.WriteLog("SendNewInfo数据库析服务已启动"); }
/// <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); } }
/// <summary> /// 开始 /// </summary> public void Start() { try { Flag = true; Bs.Start(); Gs.Start(); DA.Start(); ThreadPool.QueueUserWorkItem(CheckBussMap_Timeout); } catch (Exception e) { LogUtility.DataLog.WriteLog(LogLevel.Info, e.Message, new RunningPlace("Core", "Start"), "UdpErr"); } }
/// <summary> /// 开始数据交换服务 /// </summary> public void StartService() { try { //连接数据上传通道 us.UploadServerIP = Args.args.UploadServerIP; us.UploadServerPort = Args.args.UploadServerPort; us.ConnectionStatusChanged += UploadServer_StatusChanged; us.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } try { //连接数据交换通道 es.ExchangeServerIP = Args.args.ExchangeServerIP; es.ExchangeServerPort = Args.args.ExchangeServerPort; es.ConnectionStatusChanged += ExchangeServer_StatusChanged; es.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } try { //连接120业务服务器 bs.strRemoteIP = Args.args.BusnessServerIP; bs.nRemotePort = Args.args.BusnessServerPort; bs.nLocalPort = Args.args.BusnessServerLocalPort; bs.ConnectionStatusChanged += BusnessServer_StatusChanged; bs.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } try { //连接GPS业务服务器 gs.nLocalPort = Args.args.GPSServerLocalPort; gs.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } }
/// <summary> /// 开始数据交换服务 /// </summary> public void StartService() { //初始化单位编号及行政编码对应字典 try { InitDicUnit(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } //启动接数据上传通道 try { us.UploadServerPort = Args.args.UploadServerPort; us.ServerConnectedClientChanged += UploadServerConnectedClient_Changed; us.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } //启动数据交换通道 try { es.ExchangeServerPort = Args.args.ExchangeServerPort; es.ServerConnectedClientChanged += ExchangeServerConnectedClient_Changed; es.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } //连接120业务服务器 try { bs.strRemoteIP = Args.args.BusnessServerIP; bs.nRemotePort = Args.args.BusnessServerPort; bs.nLocalPort = Args.args.BusnessServerLocalPort; bs.ConnectionStatusChanged += BServerConnectionStatus_Changed; bs.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } //启动GPS业务服务器UDP监听 try { gs.nLocalPort = Args.args.GPSServerLocalPort; gs.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } //启动市本地库往全局库上传业务 try { LocalSyncDataThread = new Thread(new SyncLocalData().StartSyncLocalData); LocalSyncDataThread.Start(); } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } }