From 8b3caf04cbeb1e9cabeea57281c3eb3f84b080ef Mon Sep 17 00:00:00 2001 From: NklsP Date: Fri, 23 Aug 2024 09:42:50 +0200 Subject: [PATCH] When a primary host application is provided, wait before sending NBIRTH and DBIRTH. --- src/SparkplugNet/Core/Node/SparkplugNodeBase.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SparkplugNet/Core/Node/SparkplugNodeBase.cs b/src/SparkplugNet/Core/Node/SparkplugNodeBase.cs index 27df22d..a2b7adb 100644 --- a/src/SparkplugNet/Core/Node/SparkplugNodeBase.cs +++ b/src/SparkplugNet/Core/Node/SparkplugNodeBase.cs @@ -364,6 +364,12 @@ private async Task PublishNodeAndDeviceBirthsInternal() // Increment the sequence number. this.IncrementLastSequenceNumber(); + // When a primary host application is provided, wait before sending NBIRTH and DBIRTH. + if (!string.IsNullOrEmpty(this.Options.ScadaHostIdentifier)) + { + return; + } + // Publish the message. await this.client.PublishAsync(nodeBirthMessage, this.Options.CancellationToken.Value);