Skip to content

Commit 506862f

Browse files
Fixed subscriber issue where connection retry was being attempted during disconnect
1 parent ed8cba4 commit 506862f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/transport/DataSubscriber.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//******************************************************************************************************
2525

2626
#include "DataSubscriber.h"
27-
#include "Version.h"
27+
#include "../Version.h"
2828
#include "Constants.h"
2929
#include "CompactMeasurement.h"
3030
#include "../Convert.h"
@@ -150,7 +150,7 @@ bool SubscriberConnector::Connect(DataSubscriber& subscriber, bool autoReconnect
150150

151151
m_cancel = false;
152152

153-
while (true)
153+
while (!subscriber.m_disconnecting)
154154
{
155155
if (m_maxRetries != -1 && m_connectAttempt >= m_maxRetries)
156156
{
@@ -181,7 +181,7 @@ bool SubscriberConnector::Connect(DataSubscriber& subscriber, bool autoReconnect
181181
errorMessage = current_exception_diagnostic_information(true);
182182
}
183183

184-
if (!connected)
184+
if (!connected && !subscriber.m_disconnecting)
185185
{
186186
// Apply exponential back-off algorithm for retry attempt delays
187187
int32_t retryInterval = m_connectAttempt > 0 ? m_retryInterval * int32_t(pow(2, m_connectAttempt - 1)) : 0;

0 commit comments

Comments
 (0)