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

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

FixedDelayStrategy is an implementation that delays for a fixed time period, as specified in the constructor, when reconnecting to the same server as we were previously connected to, or if we are invoked again for the first server we ever tried. More...

`#include <ReconnectDelayStrategyImpl.hpp>`

Inheritance diagram for AMPS::FixedDelayStrategy:

## Public Member Functions
| FixedDelayStrategy (unsigned int duration_=200, unsigned maximum_=0)
| Construct a FixedDelayStrategy with a given duration. 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...

## Detailed Description

FixedDelayStrategy is an implementation that delays for a fixed time period, as specified in the constructor, when reconnecting to the same server as we were previously connected to, or if we are invoked again for the first server we ever tried.

## Constructor & Destructor Documentation

## ◆ FixedDelayStrategy()

AMPS::FixedDelayStrategy::FixedDelayStrategy | ( | unsigned int | duration_ = `200`,
|  | unsigned | maximum_ = `0`
| ) |  |
| inline

Construct a FixedDelayStrategy with a given duration.

Parameters

  duration_ | The delay (milliseconds) to be used between reconnect attempts to the same server. (defaults to 200ms).
  maximum_ | The maximum time (milliseconds) to retry before giving up. Default is 0, or don't give up.

## Member Function Documentation

## ◆ getConnectWaitDuration()

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

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."

Implements AMPS::ReconnectDelayStrategyImpl.

## ◆ reset()

void AMPS::FixedDelayStrategy::reset | ( | void |  | ) |
| inline virtual

Reset the state of this reconnect delay.

AMPS calls this method when a connection is successfully established.

Implements AMPS::ReconnectDelayStrategyImpl.

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

- include/amps/ReconnectDelayStrategyImpl.hpp