Пример #1
0
 private void AfterChangeTheObject(ClientInformationModel theModelTobeUpdated)
 {
     try
     {
         foreach (string address in theModelTobeUpdated.GetActivedAddress())
         {
             _TheClientProxy.TheServiceStatusChanged(true, address);
         }
     }
     catch (FaultException)
     {
         throw new ApplicationException("业务已经完成,但是通知客户端服务已经改变未能成功,可能是客户端已经关闭");
     }
 }
        private void AfterChangeTheObject(ClientInformationModel theModelTobeUpdated)
        {
            ListenAddressModel listenAddressModel = theModelTobeUpdated.GetTheAddressModelById(_TheListenAddressId);

            if (!listenAddressModel.IsActivited)
            {
                return;
            }

            try
            {
                _TheClientProxy.TheServiceStatusChanged(true, listenAddressModel.ListenAddress);
            }
            catch (FaultException)
            {
                throw new ApplicationException("业务已经完成,但是通知客户端服务已经改变未能成功,可能是客户端已经关闭");
            }
        }
 public void OnStopServer()
 {
     foreach (ClientInformationModel cam in _TheDal.GetAllClientInfomationModel())
     {
         foreach (string address in cam.GetBoardCastAddress())
         {
             try
             {
                 _TheSingleClientProxy.TheServiceStatusChanged(false, address);
             }
             //该地址出现问题了
             catch
             {
                 cam.CloseTheAddress(address);
                 _TheDal.UpdateClientInfomationModel(cam);
             }
         }
     }
 }