function NextRetryDelay(const RetryContext: TScRetryContext): cardinal; virtual; abstract;

 

Description

The NextRetryDelay method returns the time to wait before the next reconnect attempt or -1 if the TScHubConnection must stop reconnect attempts.

NextRetryDelay takes a single argument of the TScRetryContext type, that has three properties: PreviousRetryCount, ElapsedTime and RetryReason which are a Int64, a Cardinal and an Exception respectively. Before the first reconnect attempt, both RetryContext.PreviousRetryCount and RetryContext.ElapsedTime are set to zero, and the RetryContext.RetryReason is the Exception that caused the connection loss. After each failed retry attempt, RetryContext.PreviousRetryCount is incremented by one, RetryContext.ElapsedTime is updated to reflect the amount of time spent reconnecting so far, and the RetryContext.RetryReason is the Exception that caused the last reconnect attempt to fail.

 

This method is called by TScHubConnection to determine the timing and number of automatic reconnect attempts. This is abstract method and it must be overriden by an inheritor class.

 

See Also

TScHubConnection.ReconnectPolicy

 

SecureBridge Components, Copyright © 2007-2024 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support