AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.3.0
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...
 
ReconnectDelayStrategyImplget (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

AMPS::ReconnectDelayStrategy::ReconnectDelayStrategy ( )
inline

Constructs a ReconnectDelayStrategy with a default implementation.

Chooses an AMPS::ExponentiaDelayStrategy by default.

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

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
Anyexception thrown indicates no connection should be attempted; the client should in essence "give up."
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: