compile errors due to missing changes for the introduction of setMinWaitBetweenReconnectionRetries and getMinWaitBetweenReconnectionRetries
This commit is contained in:
parent
d26664fccc
commit
b6234ff908
@ -10,16 +10,22 @@
|
|||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
uint32_t calculateRetryWaitMilliseconds(uint32_t retry_count,
|
uint32_t calculateRetryWaitMilliseconds(uint32_t retryCount,
|
||||||
uint32_t maxWaitBetweenReconnectionRetries)
|
uint32_t maxWaitBetweenReconnectionRetries,
|
||||||
|
uint32_t minWaitBetweenReconnectionRetries)
|
||||||
{
|
{
|
||||||
uint32_t wait_time = (retry_count < 26) ? (std::pow(2, retry_count) * 100) : 0;
|
uint32_t waitTime = (retryCount < 26) ? (std::pow(2, retryCount) * 100) : 0;
|
||||||
|
|
||||||
if (wait_time > maxWaitBetweenReconnectionRetries || wait_time == 0)
|
if (waitTime < minWaitBetweenReconnectionRetries)
|
||||||
{
|
{
|
||||||
wait_time = maxWaitBetweenReconnectionRetries;
|
waitTime = minWaitBetweenReconnectionRetries;
|
||||||
}
|
}
|
||||||
|
|
||||||
return wait_time;
|
if (waitTime > maxWaitBetweenReconnectionRetries || waitTime == 0)
|
||||||
|
{
|
||||||
|
waitTime = maxWaitBetweenReconnectionRetries;
|
||||||
|
}
|
||||||
|
|
||||||
|
return waitTime;
|
||||||
}
|
}
|
||||||
} // namespace ix
|
} // namespace ix
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
uint32_t calculateRetryWaitMilliseconds(uint32_t retry_count,
|
uint32_t calculateRetryWaitMilliseconds(uint32_t retryCount,
|
||||||
uint32_t maxWaitBetweenReconnectionRetries);
|
uint32_t maxWaitBetweenReconnectionRetries,
|
||||||
|
uint32_t minWaitBetweenReconnectionRetries);
|
||||||
} // namespace ix
|
} // namespace ix
|
||||||
|
@ -103,6 +103,7 @@ namespace ix
|
|||||||
void setMaxWaitBetweenReconnectionRetries(uint32_t maxWaitBetweenReconnectionRetries);
|
void setMaxWaitBetweenReconnectionRetries(uint32_t maxWaitBetweenReconnectionRetries);
|
||||||
void setMinWaitBetweenReconnectionRetries(uint32_t minWaitBetweenReconnectionRetries);
|
void setMinWaitBetweenReconnectionRetries(uint32_t minWaitBetweenReconnectionRetries);
|
||||||
uint32_t getMaxWaitBetweenReconnectionRetries() const;
|
uint32_t getMaxWaitBetweenReconnectionRetries() const;
|
||||||
|
uint32_t getMinWaitBetweenReconnectionRetries() const;
|
||||||
const std::vector<std::string>& getSubProtocols();
|
const std::vector<std::string>& getSubProtocols();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -141,7 +142,9 @@ namespace ix
|
|||||||
// Automatic reconnection
|
// Automatic reconnection
|
||||||
std::atomic<bool> _automaticReconnection;
|
std::atomic<bool> _automaticReconnection;
|
||||||
static const uint32_t kDefaultMaxWaitBetweenReconnectionRetries;
|
static const uint32_t kDefaultMaxWaitBetweenReconnectionRetries;
|
||||||
|
static const uint32_t kDefaultMinWaitBetweenReconnectionRetries;
|
||||||
uint32_t _maxWaitBetweenReconnectionRetries;
|
uint32_t _maxWaitBetweenReconnectionRetries;
|
||||||
|
uint32_t _minWaitBetweenReconnectionRetries;
|
||||||
|
|
||||||
// Make the sleeping in the automatic reconnection cancellable
|
// Make the sleeping in the automatic reconnection cancellable
|
||||||
std::mutex _sleepMutex;
|
std::mutex _sleepMutex;
|
||||||
|
Loading…
Reference in New Issue
Block a user