Bläddra i källkod

Merge branch 'pr/301' into develop

release/3.x.x
Christian Kratky 6 år sedan
förälder
incheckning
f86a5af794
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. +4
    -2
      Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs

+ 4
- 2
Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs Visa fil

@@ -349,12 +349,14 @@ namespace MQTTnet.Client
keepAliveSendInterval = _options.KeepAliveSendInterval.Value;
}

if (_sendTracker.Elapsed > keepAliveSendInterval)
var waitTime = keepAliveSendInterval - _sendTracker.Elapsed;
if (waitTime <= TimeSpan.Zero)
{
await SendAndReceiveAsync<MqttPingRespPacket>(new MqttPingReqPacket(), cancellationToken).ConfigureAwait(false);
waitTime = keepAliveSendInterval;
}

await Task.Delay(keepAliveSendInterval, cancellationToken).ConfigureAwait(false);
await Task.Delay(waitTime, cancellationToken).ConfigureAwait(false);
}
}
catch (Exception exception)


Laddar…
Avbryt
Spara