AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.4

Public Member Functions | List of all members
AMPS::ReconnectDelayStrategy Class Reference

ReconnectDelayStrategy is called by AMPS::HAClient to determine how long to wait between attempts to connect or reconnect to a server. More...

`#include <ReconnectDelayStrategy.hpp>`

## Public Member Functions
| ReconnectDelayStrategy ()
| Constructs a ReconnectDelayStrategy with a default implementation. More...
| ReconnectDelayStrategy (ReconnectDelayStrategyImpl *pImpl_)
| Constructs a ReconnectDelayStrategy with a given implementation. More...
unsigned int | getConnectWaitDuration (const std::string &uri_)
| Returns the time that the client should delay before connecting to the given server URI. More...
void | reset (void)
| Reset the state of this reconnect delay. More...
ReconnectDelayStrategyImpl * | get (void)
| Returns a pointer to the raw ReconnetDelayStrategyImpl this class is wrapping.

## Detailed Description

ReconnectDelayStrategy is called by AMPS::HAClient to determine how long to wait between attempts to connect or reconnect to a server.

The class is implemented as a handle that reference counts an instance of AMPS::ReconnectDelayStrategyImpl.

## Constructor & Destructor Documentation

## ◆ ReconnectDelayStrategy() [1/2]

AMPS::ReconnectDelayStrategy::ReconnectDelayStrategy | ( |  | ) |
| inline

Constructs a ReconnectDelayStrategy with a default implementation.

Chooses an AMPS::ExponentialDelayStrategy by default.

## ◆ ReconnectDelayStrategy() [2/2]

AMPS::ReconnectDelayStrategy::ReconnectDelayStrategy | ( | ReconnectDelayStrategyImpl * | pImpl_ | ) |
| inline

Constructs a ReconnectDelayStrategy with a given implementation.

Parameters

  pImpl_ | An instance of a class derived from AMPS::ReconnectDelayStrategyImpl to wrap.

## Member Function Documentation

## ◆ getConnectWaitDuration()

unsigned int AMPS::ReconnectDelayStrategy::getConnectWaitDuration | ( | const std::string & | uri_ | ) |
| inline

Returns the time that the client should delay before connecting to the given server URI.

Parameters

  uri_ | The URI which the client plans to connect.

Returns
  The time, in milliseconds, which the client should delay before connecting to uri_.

Exceptions

  Any | exception thrown indicates no connection should be attempted; the client should in essence "give up."

## ◆ reset()

void AMPS::ReconnectDelayStrategy::reset | ( | void |  | ) |
| inline

Reset the state of this reconnect delay.

AMPS calls this method when a connection is successfully established.

The documentation for this class was generated from the following file:

- include/amps/ReconnectDelayStrategy.hpp