AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.4.4
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

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

unsigned int AMPS::FixedDelayStrategy::getConnectWaitDuration ( const std::string &  uri_)
inlinevirtual

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

Implements AMPS::ReconnectDelayStrategyImpl.

void AMPS::FixedDelayStrategy::reset ( void  )
inlinevirtual

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: