Partager via


CM_TIME_BASED_AUTO_RECONNECT_ALGORITHM (Compact 7)

3/12/2014

This enumeration lists algorithm options for reconnection behavior when CMCB_ALWAYS_CONNECTED connections are lost.

Syntax

typedef enum CM_TIME_BASED_AUTO_RECONNECT_ALGORITHM
{
    CMTR_DEFAULT,
    CMTR_NONE,
    CMTR_LINEAR,
    CMTR_EXPONENTIAL_RANDOMIZED_BACKOFF,

    CMTR_LAST

} CM_TIME_BASED_AUTO_RECONNECT_ALGORITHM;

Element Definitions

  • CMTR_DEFAULT
    The default retry supported inbox.
  • CMTR_NONE
    No retries based on time will be attempted. This is the recommended default.

    Reconnection attempts are caused only by retry notifications based on system events. For example, a CMRR_CONNECTION_AVAILABLE_TO_CONNECT notification occurs. See Connection Manager Status and Notification Reference.

  • CMTR_LINEAR
    Reconnection is attempted based on CM_CONNECTION_CONFIG structure values using a three-stage algorithm:

    1. Attempts reconnections are attempted every DelaySec seconds.
    2. After Attempts reconnection attempts, an unlimited number of reconnection attempts are made every AttemptsExceededDelaySec seconds.
    3. If AttemptsExceededDelaySec == INFINITE then no time-driven attempts are made beyond the number in Attempts.

    In pseudo-code this is:

    for ( int i = 1; i < Attempts; i++ ){
        // wait DelaySec
        // reconnection attempt
    }
    if ( AttemptsExceededDelaySec != INFINITE )
    for ( int i = 1; i < Attempts; i++ ){
        // wait AttemptsExceededDelaySec
        // reconnection attempt
    }
    
  • CMTR_EXPONENTIAL_RANDOMIZED_BACKOFF
    Reconnection is attempted every 2^i * DelaySec, with i = 1, 2, …, Attempts, with i increasing after each successive failed attempt, resetting to 1 when connection is connected.

    AttemptsExceededDelaySec behaves as specified in CMTR_LINEAR, above.

    In pseudo-code this is:

    for ( int i = 1; i < Attempts; i++ ){
        // wait ( pow(2,i) * DelaySec )
        // reconnection attempt
    }
    if ( AttemptsExceededDelaySec != INFINITE )
    for ( int i = 1; i < Attempts; i++ ){
        // wait AttemptsExceededDelaySec
        // reconnection attempt
    }
    
  • CMTR_LAST
    The last value.

Requirements

Header

cmnet.h

See Also

Reference

Connection Manager Connection Configuration Enumerations
CM_CONNECTION_CONFIG
Connection Manager Status and Notification Reference