/// <inheritdoc />
        public override void Apply(WcfInvocation wcfInvocation)
        {
			int retries = 0;
			Random random = null;

			while (true)
			{
				try
				{
					wcfInvocation.Proceed();
					return;
				}
				catch (TimeoutException)
				{
					if (retries++ >= MaxRetries)
						throw;
				}

				if (random == null)
					random = new Random();

				PerformBackoff(retries, random);

				wcfInvocation.Refresh(false);
			};
        }
Example #2
0
        /// <inheritdoc />
        public override void Apply(WcfInvocation wcfInvocation)
        {
            int    retries = 0;
            Random random  = null;

            while (true)
            {
                try
                {
                    wcfInvocation.Proceed();
                    return;
                }
                catch (TimeoutException)
                {
                    if (retries++ >= MaxRetries)
                    {
                        throw;
                    }
                }

                if (random == null)
                {
                    random = new Random();
                }

                PerformBackoff(retries, random);

                wcfInvocation.Refresh(false);
            }
        }
Example #3
0
        /// <inheritdoc />
        public override void Apply(WcfInvocation wcfInvocation)
        {
            var refresh = false;

            try
            {
                wcfInvocation.Refresh(false).Proceed();
            }
            catch (ChannelTerminatedException)
            {
                refresh = true;
            }
            catch (CommunicationObjectFaultedException)
            {
                refresh = true;
            }
            catch (CommunicationObjectAbortedException)
            {
                refresh = true;
            }
            catch (MessageSecurityException)
            {
                refresh = true;
            }
			catch (EndpointNotFoundException)  // Could happen with discovery
			{
				refresh = true;
			}
            catch (CommunicationException exception)
            {
                if (exception.GetType() != typeof(CommunicationException))
                {
                    throw;
                }
                refresh = true;
            }

            if (refresh)
            {
                wcfInvocation.Refresh(true).Proceed();
            }
        }
Example #4
0
        /// <inheritdoc />
        public override void Apply(WcfInvocation wcfInvocation)
        {
            var refresh = false;

            try
            {
                wcfInvocation.Refresh(false).Proceed();
            }
            catch (ChannelTerminatedException)
            {
                refresh = true;
            }
            catch (CommunicationObjectFaultedException)
            {
                refresh = true;
            }
            catch (CommunicationObjectAbortedException)
            {
                refresh = true;
            }
            catch (MessageSecurityException)
            {
                refresh = true;
            }
            catch (EndpointNotFoundException)              // Could happen with discovery
            {
                refresh = true;
            }
            catch (CommunicationException exception)
            {
                if (exception.GetType() != typeof(CommunicationException))
                {
                    throw;
                }
                refresh = true;
            }

            if (refresh)
            {
                wcfInvocation.Refresh(true).Proceed();
            }
        }
        /// <inheritdoc />
        public override void Apply(WcfInvocation wcfInvocation)
        {
            var reconnect = false;

            try
            {
                wcfInvocation.Refresh().Proceed();
            }
            catch (ChannelTerminatedException)
            {
                reconnect = true;
            }
            catch (CommunicationObjectFaultedException)
            {
                reconnect = true;
            }
            catch (CommunicationObjectAbortedException)
            {
                reconnect = true;
            }
            catch (MessageSecurityException)
            {
                reconnect = true;
            }
            catch (CommunicationException exception)
            {
                if (exception.GetType() != typeof(CommunicationException))
                {
                    throw;
                }
                reconnect = true;
            }

            if (reconnect)
            {
                wcfInvocation.Refresh().Proceed();
            }
        }
Example #6
0
		public abstract void Apply(WcfInvocation invocation);
Example #7
0
 public abstract void Apply(WcfInvocation invocation);