From 20ce9d5b5a288b458cda932c85c2e460c6b83a31 Mon Sep 17 00:00:00 2001 From: Peguen <73380451+Peguen@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:52:53 +0200 Subject: [PATCH 1/2] Removed HostName in registration config, added usage in attribute builder. --- ecal/core/include/ecal/config/registration.h | 15 +++++++-------- .../builder/registration_attribute_builder.cpp | 13 ++++++++++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ecal/core/include/ecal/config/registration.h b/ecal/core/include/ecal/config/registration.h index 2cd3466bd4..08c39bdc12 100644 --- a/ecal/core/include/ecal/config/registration.h +++ b/ecal/core/include/ecal/config/registration.h @@ -25,7 +25,6 @@ #pragma once #include "ecal/ecal_os.h" -#include "ecal/ecal_process.h" #include #include @@ -64,14 +63,14 @@ namespace eCAL struct Configuration { - unsigned int registration_timeout { 10000U }; //!< Timeout for topic registration in ms (internal) (Default: 10000) - unsigned int registration_refresh { 1000U }; //!< Topic registration refresh cylce (has to be smaller then registration timeout!) (Default: 1000) + unsigned int registration_timeout { 10000U }; //!< Timeout for topic registration in ms (internal) (Default: 10000) + unsigned int registration_refresh { 1000U }; //!< Topic registration refresh cylce (has to be smaller then registration timeout!) (Default: 1000) - bool network_enabled { false }; /*!< true = all eCAL components communicate over network boundaries - false = local host only communication (Default: false) */ - bool loopback { true }; //!< enable to receive udp messages on the same local machine (Default: true) - std::string host_group_name { eCAL::Process::GetHostName() }; /*!< Common host group name that enables interprocess mechanisms across - (virtual) host borders (e.g, Docker); by default equivalent to local host name (Default: CurrentHostName) */ + bool network_enabled { false }; /*!< true = all eCAL components communicate over network boundaries + false = local host only communication (Default: false) */ + bool loopback { true }; //!< enable to receive udp messages on the same local machine (Default: true) + std::string host_group_name { "" }; /*!< Common host group name that enables interprocess mechanisms across + (virtual) host borders (e.g, Docker); by default equivalent to local host name (Default: CurrentHostName) */ Layer::Configuration layer; }; } diff --git a/ecal/core/src/builder/registration_attribute_builder.cpp b/ecal/core/src/builder/registration_attribute_builder.cpp index 2516afb2d7..a77022a96a 100644 --- a/ecal/core/src/builder/registration_attribute_builder.cpp +++ b/ecal/core/src/builder/registration_attribute_builder.cpp @@ -18,6 +18,7 @@ */ #include "registration_attribute_builder.h" +#include "ecal/ecal_process.h" namespace eCAL { @@ -29,7 +30,17 @@ namespace eCAL attr.refresh = reg_config_.registration_refresh; attr.network_enabled = reg_config_.network_enabled; attr.loopback = reg_config_.loopback; - attr.host_group_name = reg_config_.host_group_name; + + // TODO: Check the usage further down of host_group_name -> logic currenty missleading + if (reg_config_.host_group_name.empty()) + { + attr.host_group_name = eCAL::Process::GetHostName(); + } + else + { + attr.host_group_name = reg_config_.host_group_name; + } + attr.process_id = process_id_; attr.shm_enabled = reg_config_.layer.shm.enable; From 65f9de3b23f88cc44e3b892758917a79665cbee2 Mon Sep 17 00:00:00 2001 From: Peguen <73380451+Peguen@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:54:46 +0200 Subject: [PATCH 2/2] Default value in comments adapted. --- ecal/core/include/ecal/config/registration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecal/core/include/ecal/config/registration.h b/ecal/core/include/ecal/config/registration.h index 08c39bdc12..79f9798a06 100644 --- a/ecal/core/include/ecal/config/registration.h +++ b/ecal/core/include/ecal/config/registration.h @@ -70,7 +70,7 @@ namespace eCAL false = local host only communication (Default: false) */ bool loopback { true }; //!< enable to receive udp messages on the same local machine (Default: true) std::string host_group_name { "" }; /*!< Common host group name that enables interprocess mechanisms across - (virtual) host borders (e.g, Docker); by default equivalent to local host name (Default: CurrentHostName) */ + (virtual) host borders (e.g, Docker); by default equivalent to local host name (Default: "") */ Layer::Configuration layer; }; }