ReliableSessionBindingElement.MaxRetryCount Property

 

Gets or sets the maximum number of times that a message attempts to be transferred during the reliable session.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public int MaxRetryCount { get; set; }

Property Value

Type: System.Int32

The maximum number of times that a message attempts to be re-sent. The minimum value is 1; the maximum is MaxValue; and the default value is 8.

Exception Condition
ArgumentOutOfRangeException

The value set is less than or equal to zero.

A message is considered to be transferred if its delivery at the recipient has been acknowledged by the recipient.

If an acknowledgment has not been received within a certain amount of time for a message that has been transmitted, the infrastructure automatically retransmits the message. The infrastructure tries to send the message for, at most, a MaxRetryCount number of times. Not receiving an acknowledgment before this limit is reached is considered a fatal communication failure and causes the channel faulted event to be raised.

The infrastructure uses an exponential back-off algorithm to determine when to retransmit, based on a computed average round-trip time. The initial retry time is computed based on the measured roundtrip time of establishing the session. The retransmission algorithm doubles the delay with every attempt, which results in approximately 8.5 minutes passing between the first transmission attempt and the last retransmission attempt. The time for the first retransmission attempt is adjusted according to the calculated round-trip time and the resulting stretch of time that those attempts take varies accordingly. This allows the retransmission time to dynamically adapt to varying network conditions.

.NET Framework
Available since 3.0
Return to top
Show: