AMPS C# Client  5.3.3.4
AMPS C# Client for .NET
AMPS.Client.FixedDelayStrategy Class Reference

More...

+ Inheritance diagram for AMPS.Client.FixedDelayStrategy:

Classes

class  MaximumRetryExceeded
 A specialized exception type thrown by FixedDelayStrategy to indicate that the client should "give up" on attempting to reconnect to a server. More...
 

Public Member Functions

 FixedDelayStrategy (int delay_=DEFAULT_DELAY, int maximum_=-1)
 Construct a FixedDelayStrategy with a specified delay and maximum More...
 
int getConnectWaitDuration (String uri_)
 Returns the time (in milliseconds) that the client should wait before connecting to the given server URI. More...
 
void reset ()
 Reset the state of this reconnect delay. AMPS calls this method when a connection is successfully established. More...
 

Static Public Attributes

const int DEFAULT_DELAY = 200
 The default delay when reconnecting to a server, in milliseconds. More...
 

Protected Attributes

int _delay
 
double _maximum
 
DateTime _endTime
 
String _lastUri
 
String _firstUri
 

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. ReconnectDelayStrategy implementations are used by the HAClient.

Constructor & Destructor Documentation

◆ FixedDelayStrategy()

AMPS.Client.FixedDelayStrategy.FixedDelayStrategy ( int  delay_ = DEFAULT_DELAY,
int  maximum_ = -1 
)
inline

Construct a FixedDelayStrategy with a specified delay and maximum

timeout. The delay defaults to the DEFAULT_DELAY and the maximum timeout defaults to 0, which indicates that the delay strategy has no maximum, and will continue allowing the client to connect indefinitely.

Parameters
delay_The delay (milliseconds) to be used between reconnect attempts to the same server.
maximum_The maximum time (milliseconds) to attempt retry before giving up.

Member Function Documentation

◆ getConnectWaitDuration()

int AMPS.Client.FixedDelayStrategy.getConnectWaitDuration ( String  uri_)
inline

Returns the time (in milliseconds) that the client should wait before connecting to the given server URI.

Parameters
uri_The URI to which the client plans to connect.
Exceptions
ExceptionAny exception thrown indicates no connection should be attempted. The client, in essence, should "give up."

Implements AMPS.Client.ReconnectDelayStrategy.

◆ reset()

void AMPS.Client.FixedDelayStrategy.reset ( )
inline

Reset the state of this reconnect delay. AMPS calls this method when a connection is successfully established.

Implements AMPS.Client.ReconnectDelayStrategy.

Member Data Documentation

◆ DEFAULT_DELAY

const int AMPS.Client.FixedDelayStrategy.DEFAULT_DELAY = 200
static

The default delay when reconnecting to a server, in milliseconds.


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