Kaynağa Gözat

Increase delay for Keep Alive checks to decrease CPU load.

release/3.x.x
Christian 2 yıl önce
ebeveyn
işleme
c6f4b59438
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. +2
    -2
      Source/MQTTnet/Client/MqttClient.cs

+ 2
- 2
Source/MQTTnet/Client/MqttClient.cs Dosyayı Görüntüle

@@ -455,7 +455,7 @@ namespace MQTTnet.Client
_logger.Verbose("Start sending keep alive packets."); _logger.Verbose("Start sending keep alive packets.");


var keepAlivePeriod = Options.KeepAlivePeriod; var keepAlivePeriod = Options.KeepAlivePeriod;
while (!cancellationToken.IsCancellationRequested) while (!cancellationToken.IsCancellationRequested)
{ {
// Values described here: [MQTT-3.1.2-24]. // Values described here: [MQTT-3.1.2-24].
@@ -470,7 +470,7 @@ namespace MQTTnet.Client
// due to some edge cases and was buggy in the past. Now we wait several ms because the // due to some edge cases and was buggy in the past. Now we wait several ms because the
// min keep alive value is one second so that the server will wait 1.5 seconds for a PING // min keep alive value is one second so that the server will wait 1.5 seconds for a PING
// packet. // packet.
await Task.Delay(TimeSpan.FromMilliseconds(100), cancellationToken).ConfigureAwait(false);
await Task.Delay(250, cancellationToken).ConfigureAwait(false);
} }
} }
catch (Exception exception) catch (Exception exception)


Yükleniyor…
İptal
Kaydet