/// <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); } }