The time (in milliseconds) to wait before reconnecting to a server after a failed connection. The default value is 200 ms.
The maximum time (milliseconds) to allow reconnect attempts to continue without a successful connection, before giving up and abandoning the connection attempt. If zero, the client never gives up. The default value is 0.
The object with delay parameters, such as delay and maximumRetryTime.
This method returns the time (in milliseconds) that the client should delay before connecting to the given server URI.
The URI of the server.
The time (in milliseconds) that the client should delay.
This method resets the state of this reconnect delay. AMPS calls this method when a connection is established.
FixedDelayStrategy is a reconnect delay strategy implementation that waits a fixed amount of time before retrying a connection.
Create the fixed strategy with all default values:
const strategy = new FixedDelayStrategy();
Set the maximum retry time to 15 seconds, leave the default delay value:
const strategy = new FixedDelayStrategy({maximumRetryTime: 15000});
Set all params as arguments...
const strategy = new FixedDelayStrategy(2000, 45000);
... or using the object with values:
const strategy = new FixedDelayStrategy({delay: 2000, maximumRetryTime: 45000});