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.
More...
|
const int | DEFAULT_DELAY = 200 |
| The default delay when reconnecting to a server, in milliseconds. More...
|
|
|
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.
◆ 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 -1
, 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. |
◆ 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 intends to connect. |
- Returns
- Returns the time in milliseconds the client should delay before connecting to uri_.
- Exceptions
-
Implements AMPS.Client.ReconnectDelayStrategy.
◆ reset()
void AMPS.Client.FixedDelayStrategy.reset |
( |
| ) |
|
|
inline |
◆ 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:
- AMPS.Client/FixedDelayStrategy.cs