AMPS C# Client
5.3.3.4
AMPS C# Client for .NET
|
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 |
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.
|
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.
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. |
|
inline |
Returns the time (in milliseconds) that the client should wait before connecting to the given server URI.
uri_ | The URI to which the client plans to connect. |
Exception | Any exception thrown indicates no connection should be attempted. The client, in essence, should "give up." |
Implements AMPS.Client.ReconnectDelayStrategy.
|
inline |
Reset the state of this reconnect delay. AMPS calls this method when a connection is successfully established.
Implements AMPS.Client.ReconnectDelayStrategy.
|
static |
The default delay when reconnecting to a server, in milliseconds.