/// <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); }; }
/// <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); } }
/// <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(); } }
public abstract void Apply(WcfInvocation invocation);