diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp index 2a83c809b50..ae9e061e35b 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.cpp @@ -62,7 +62,6 @@ bool HelloWorldPublisher::init( const std::string& topic_name, const std::string& server_address, unsigned short server_port, - unsigned short server_id, TransportKind transport) { hello_.index(0); @@ -142,7 +141,14 @@ bool HelloWorldPublisher::init( server_locator.kind = LOCATOR_KIND_TCPv6; eprosima::fastdds::rtps::IPLocator::setLogicalPort(server_locator, server_port); - eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, ip_server_address); + if (eprosima::fastdds::rtps::IPLocator::isIPv6(ip_server_address)) + { + eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, ip_server_address); + } + else + { + eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, "::1"); + } break; } @@ -154,15 +160,8 @@ bool HelloWorldPublisher::init( pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = eprosima::fastdds::rtps::DiscoveryProtocol::CLIENT; - // Set SERVER's GUID prefix - RemoteServerAttributes remote_server_att; - remote_server_att.guidPrefix = get_discovery_server_guid_from_id(server_id); - - // Set SERVER's listening locator for PDP - remote_server_att.metatrafficUnicastLocatorList.push_back(server_locator); - // Add remote SERVER to CLIENT's list of SERVERs - pqos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + pqos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server_locator); // Add descriptor pqos.transport().user_transports.push_back(descriptor); @@ -179,7 +178,6 @@ bool HelloWorldPublisher::init( "Publisher Participant " << pqos.name() << " created with GUID " << participant_->guid() << " connecting to server <" << server_locator << "> " << - " with Guid: <" << remote_server_att.guidPrefix << "> " << std::endl; // REGISTER THE TYPE diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h index a3e9b5e01d8..8397dd5472b 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerPublisher.h @@ -46,7 +46,6 @@ class HelloWorldPublisher const std::string& topic_name, const std::string& server_address, unsigned short server_port, - unsigned short server_id, TransportKind transport); //! Publish a sample diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp index 60a915899fb..e659bd8ad39 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.cpp @@ -57,12 +57,10 @@ void DiscoveryServer::stop() bool DiscoveryServer::init( const std::string& server_address, unsigned short server_port, - unsigned short server_id, TransportKind transport, bool has_connection_server, const std::string& connection_server_address, - unsigned short connection_server_port, - unsigned short connection_server_id) + unsigned short connection_server_port) { DomainParticipantQos pqos; pqos.name("DS-Server"); @@ -163,7 +161,14 @@ bool DiscoveryServer::init( listening_locator.kind = LOCATOR_KIND_TCPv6; eprosima::fastdds::rtps::IPLocator::setLogicalPort(listening_locator, server_port); - eprosima::fastdds::rtps::IPLocator::setIPv6(listening_locator, ip_listening_address); + if (eprosima::fastdds::rtps::IPLocator::isIPv6(ip_listening_address)) + { + eprosima::fastdds::rtps::IPLocator::setIPv6(listening_locator, ip_listening_address); + } + else + { + eprosima::fastdds::rtps::IPLocator::setIPv6(listening_locator, "::1"); + } connection_locator.kind = LOCATOR_KIND_TCPv6; eprosima::fastdds::rtps::IPLocator::setIPv6(connection_locator, ip_connection_address); eprosima::fastdds::rtps::IPLocator::setLogicalPort(connection_locator, connection_server_port); @@ -181,9 +186,6 @@ bool DiscoveryServer::init( pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = eprosima::fastdds::rtps::DiscoveryProtocol::SERVER; - // Set SERVER's GUID prefix - pqos.wire_protocol().prefix = get_discovery_server_guid_from_id(server_id); - // Set SERVER's listening locator for PDP pqos.wire_protocol().builtin.metatrafficUnicastLocatorList.push_back(listening_locator); @@ -191,17 +193,10 @@ bool DiscoveryServer::init( // Configure Connection address /////////////////////////////// - RemoteServerAttributes remote_server_att; if (has_connection_server) { - // Set SERVER's GUID prefix - remote_server_att.guidPrefix = get_discovery_server_guid_from_id(connection_server_id); - - // Set SERVER's listening locator for PDP - remote_server_att.metatrafficUnicastLocatorList.push_back(connection_locator); - // Add remote SERVER to CLIENT's list of SERVERs - pqos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + pqos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(connection_locator); } @@ -224,8 +219,7 @@ bool DiscoveryServer::init( "Server Participant " << pqos.name() << " created with GUID " << participant_->guid() << " listening in address <" << listening_locator << "> " << - " connecting with Discovery Server <" << remote_server_att.guidPrefix << "> " - " with address <" << connection_locator << "> " << + " connecting with Discovery Server <" << connection_locator << "> " << std::endl; } else diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h index 4fd8b6d79f7..0520eb2dc00 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerServer.h @@ -44,12 +44,10 @@ class DiscoveryServer bool init( const std::string& server_address, unsigned short server_port, - unsigned short server_id, TransportKind transport, bool has_connection_server, const std::string& connection_server_address, - unsigned short connection_server_port, - unsigned short connection_server_id); + unsigned short connection_server_port); //! Run void run( diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp index ed0dea34efe..8cfb7f3d194 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.cpp @@ -67,7 +67,6 @@ bool HelloWorldSubscriber::init( uint32_t max_messages, const std::string& server_address, unsigned short server_port, - unsigned short server_id, TransportKind transport) { DomainParticipantQos pqos; @@ -145,7 +144,14 @@ bool HelloWorldSubscriber::init( server_locator.kind = LOCATOR_KIND_TCPv6; eprosima::fastdds::rtps::IPLocator::setLogicalPort(server_locator, server_port); - eprosima::fastdds::rtps::IPLocator::setIPv4(server_locator, ip_server_address); + if (eprosima::fastdds::rtps::IPLocator::isIPv6(ip_server_address)) + { + eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, ip_server_address); + } + else + { + eprosima::fastdds::rtps::IPLocator::setIPv6(server_locator, "::1"); + } break; } @@ -157,15 +163,8 @@ bool HelloWorldSubscriber::init( pqos.wire_protocol().builtin.discovery_config.discoveryProtocol = eprosima::fastdds::rtps::DiscoveryProtocol::CLIENT; - // Set SERVER's GUID prefix - RemoteServerAttributes remote_server_att; - remote_server_att.guidPrefix = get_discovery_server_guid_from_id(server_id); - - // Set SERVER's listening locator for PDP - remote_server_att.metatrafficUnicastLocatorList.push_back(server_locator); - // Add remote SERVER to CLIENT's list of SERVERs - pqos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(remote_server_att); + pqos.wire_protocol().builtin.discovery_config.m_DiscoveryServers.push_back(server_locator); // Add descriptor pqos.transport().user_transports.push_back(descriptor); @@ -183,7 +182,6 @@ bool HelloWorldSubscriber::init( "Subscriber Participant " << pqos.name() << " created with GUID " << participant_->guid() << " connecting to server <" << server_locator << "> " << - " with Guid: <" << remote_server_att.guidPrefix << "> " << std::endl; // REGISTER THE TYPE diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h index 2b2c83ceb12..cc81aad5f6a 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServerSubscriber.h @@ -49,7 +49,6 @@ class HelloWorldSubscriber uint32_t max_messages, const std::string& server_address, unsigned short server_port, - unsigned short server_id, TransportKind transport); //! RUN the subscriber until number samples are received diff --git a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServer_main.cpp b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServer_main.cpp index e1badf3b661..e71d6b04fe0 100644 --- a/examples/cpp/dds/DiscoveryServerExample/DiscoveryServer_main.cpp +++ b/examples/cpp/dds/DiscoveryServerExample/DiscoveryServer_main.cpp @@ -64,13 +64,11 @@ int main( // Discovery Server connection std::string connection_address = "127.0.0.1"; // default ip address uint16_t connection_port = 16166; // default physical port - uint16_t connection_ds_id = 0; // default DS id bool id_ds_set = false; // Discovery Server listening std::string listening_address = "127.0.0.1"; // default ip address uint16_t listening_port = 16166; // default physical port - uint16_t listening_ds_id = 0; // default DS id uint32_t timeout = 0; // default DS id if (argc > 1) @@ -190,16 +188,13 @@ int main( } case optionIndex::CONNECTION_PORT: + id_ds_set = true; connection_port = static_cast(strtol(opt.arg, nullptr, 10)); break; case optionIndex::CONNECTION_ADDRESS: - connection_address = opt.arg; - break; - - case optionIndex::CONNECTION_DISCOVERY_SERVER_ID: id_ds_set = true; - connection_ds_id = static_cast(strtol(opt.arg, nullptr, 10)); + connection_address = opt.arg; break; case optionIndex::LISTENING_PORT: @@ -221,15 +216,6 @@ int main( break; - case optionIndex::LISTENING_DISCOVERY_SERVER_ID: - if (type != EntityKind::SERVER) - { - print_warning("server", opt.name); - break; - } - listening_ds_id = static_cast(strtol(opt.arg, nullptr, 10)); - break; - case optionIndex::TIMEOUT: if (type != EntityKind::SERVER) { @@ -268,15 +254,6 @@ int main( // return 1; // } - // Check that a DS has not same id itself and connection - if (id_ds_set && type == EntityKind::SERVER && listening_ds_id == connection_ds_id) - { - std::cerr << "ERROR: Discovery Servers ids must be different, " - << " cannot connect to a server with same id " << listening_ds_id << std::endl; - option::printUsage(fwrite, stdout, usage, columns); - return 1; - } - // Check that a DS has not same ip and port in listening and connection if (id_ds_set && type == EntityKind::SERVER && @@ -299,7 +276,6 @@ int main( topic_name, connection_address, connection_port, - connection_ds_id, transport)) { mypub.run(static_cast(count), static_cast(sleep)); @@ -319,7 +295,6 @@ int main( static_cast(count), connection_address, connection_port, - connection_ds_id, transport)) { mysub.run(static_cast(count)); @@ -337,12 +312,10 @@ int main( if (myserver.init( listening_address, listening_port, - listening_ds_id, transport, id_ds_set, connection_address, - connection_port, - connection_ds_id)) + connection_port)) { myserver.run(timeout); } diff --git a/examples/cpp/dds/DiscoveryServerExample/README.md b/examples/cpp/dds/DiscoveryServerExample/README.md index 5d3448e3274..ef236617f4e 100644 --- a/examples/cpp/dds/DiscoveryServerExample/README.md +++ b/examples/cpp/dds/DiscoveryServerExample/README.md @@ -35,9 +35,6 @@ Publisher options: Server listening port (Default port: 16166). --transport= Use Transport Protocol [udpv4|udpv6|tcpv4|tcpv6] (Default: udpv4). - -d --connection-discovery-server-id - Id of the Discovery Server to connect with. GUID will be - calculated from id (Default: 0). Subscriber options: -t --topic= @@ -51,16 +48,10 @@ Subscriber options: Server listening port (Default port: 16166). --transport= Use Transport Protocol [udpv4|udpv6|tcpv4|tcpv6] (Default: udpv4). - -d --connection-discovery-server-id - Id of the Discovery Server to connect with. GUID will be - calculated from id (Default: 0). DiscoveryServer options: --listening-address= Server address (Default address: 127.0.0.1). - --id= - Id of this Discovery Server. - GUID will be calculated from id (Default: 0). --listening-port= Server listening port (Default port: 16166). --transport= @@ -69,10 +60,6 @@ DiscoveryServer options: Server address (Default address: 127.0.0.1). -p --connection-port= Server listening port (Default port: 16166). - -d --connection-discovery-server-id - Id of the Discovery Server to connect with. GUID will be - calculated from id (if not set, this DS will not connect - to other server). -z --timeout Number of seconds before finish the process (Default: 0 = till ^C). ``` diff --git a/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h b/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h index ad01e206847..d7a888df0af 100644 --- a/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h +++ b/examples/cpp/dds/DiscoveryServerExample/arg_configuration.h @@ -169,11 +169,9 @@ enum optionIndex CONNECTION_ADDRESS, CONNECTION_PORT, - CONNECTION_DISCOVERY_SERVER_ID, LISTENING_ADDRESS, LISTENING_PORT, - LISTENING_DISCOVERY_SERVER_ID, TIMEOUT, }; @@ -239,15 +237,6 @@ const option::Descriptor usage[] = { Arg::Transport, " \t--transport \tUse Transport Protocol [udpv4|udpv6|tcpv4|tcpv6] (UDPv4 by default)." }, - { - CONNECTION_DISCOVERY_SERVER_ID, - 0, - "d", - "discovery-server-id", - Arg::Numeric, - " -d \t--connection-discovery-server-id \tId of the Discovery Server to connect with. " - "GUID will be calculated from id (0 by default)." - }, /// SUBSCRIBER OPTIONS {UNKNOWN_OPT, 0, "", "", Arg::None, "\nSubscriber options:"}, @@ -291,15 +280,6 @@ const option::Descriptor usage[] = { Arg::Transport, " \t--transport \tUse Transport Protocol [udpv4|udpv6|tcpv4|tcpv6] (UDPv4 by default)." }, - { - CONNECTION_DISCOVERY_SERVER_ID, - 0, - "d", - "discovery-server-id", - Arg::Numeric, - " -d \t--connection-discovery-server-id \tId of the Discovery Server to connect with. " - "GUID will be calculated from id (0 by default)." - }, /// SERVER OPTIONS {UNKNOWN_OPT, 0, "", "", Arg::None, "\nDiscovery Server options:"}, @@ -311,14 +291,6 @@ const option::Descriptor usage[] = { Arg::String, " \t--listening-address= \tServer address (Default address: 127.0.0.1)." }, - { - LISTENING_DISCOVERY_SERVER_ID, - 0, - "", - "id", - Arg::Numeric, - " \t--id \tId of this Discovery Server. GUID will be calculated from id (0 by default)." - }, { LISTENING_PORT, 0, @@ -351,15 +323,6 @@ const option::Descriptor usage[] = { Arg::String, " -c \t--connection-address= \tServer address (Default address: 127.0.0.1)." }, - { - CONNECTION_DISCOVERY_SERVER_ID, - 0, - "d", - "connection-discovery-server-id", - Arg::Numeric, - " -d \t--connection-discovery-server-id \tId of the Discovery Server to connect with. " - "GUID will be calculated from id (if not set, this DS will not connect to other server)." - }, { TIMEOUT, 0, diff --git a/examples/cpp/dds/DiscoveryServerExample/common.h b/examples/cpp/dds/DiscoveryServerExample/common.h index c62356266f0..2012555902d 100644 --- a/examples/cpp/dds/DiscoveryServerExample/common.h +++ b/examples/cpp/dds/DiscoveryServerExample/common.h @@ -20,7 +20,7 @@ #ifndef _EPROSIMA_FASTDDS_EXAMPLES_CPP_DDS_DISCOVERYSERVEREXAMPLE_COMMON_H_ #define _EPROSIMA_FASTDDS_EXAMPLES_CPP_DDS_DISCOVERYSERVEREXAMPLE_COMMON_H_ -#include +#include #include enum class TransportKind @@ -32,19 +32,6 @@ enum class TransportKind SHM, }; -inline eprosima::fastdds::rtps::GuidPrefix_t get_discovery_server_guid_from_id( - unsigned short id) -{ - eprosima::fastdds::rtps::GuidPrefix_t result; - - // Get default DS guid and modify the one value expected to be changed - std::istringstream(eprosima::fastdds::rtps::DEFAULT_ROS2_SERVER_GUIDPREFIX) >> result; - result.value[2] = - static_cast(id); // This is done like this in Fast - - return result; -} - inline bool is_ip( const std::string ip_str) { diff --git a/include/fastdds/rtps/attributes/RTPSParticipantAttributes.hpp b/include/fastdds/rtps/attributes/RTPSParticipantAttributes.hpp index 665297f6ed7..f42c560ba80 100644 --- a/include/fastdds/rtps/attributes/RTPSParticipantAttributes.hpp +++ b/include/fastdds/rtps/attributes/RTPSParticipantAttributes.hpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -129,6 +128,21 @@ inline std::ostream& operator <<( return output; } +/** + * Returns the guidPrefix associated to the given server id + * @param[in] id of the default server whose guidPrefix we want to retrieve + * @param[out] guid reference to the guidPrefix to modify + * @return true if the server guid can be delivered + */ +FASTDDS_EXPORTED_API bool get_server_client_default_guidPrefix( + int id, + fastdds::rtps::GuidPrefix_t& guid); + +// Port used if the ros environment variable doesn't specify one +constexpr uint16_t DEFAULT_ROS2_SERVER_PORT = 11811; +// Port used by default for tcp transport +constexpr uint16_t DEFAULT_TCP_SERVER_PORT = 42100; + //! Filtering flags when discovering participants enum ParticipantFilteringFlags : uint32_t { @@ -276,8 +290,8 @@ class DiscoverySettings */ Duration_t discoveryServer_client_syncperiod = { 0, 450 * 1000000}; // 450 milliseconds - //! Discovery Server settings, only needed if use_CLIENT_DiscoveryProtocol=true - eprosima::fastdds::rtps::RemoteServerList_t m_DiscoveryServers; + //! Discovery Server initial connections, needed if `discoveryProtocol` = CLIENT | SUPER_CLIENT | SERVER | BACKUP + eprosima::fastdds::rtps::LocatorList m_DiscoveryServers; //! Filtering participants out depending on location ParticipantFilteringFlags ignoreParticipantFlags = ParticipantFilteringFlags::NO_FILTER; diff --git a/include/fastdds/rtps/common/Locator.hpp b/include/fastdds/rtps/common/Locator.hpp index 88651429434..d688186a572 100644 --- a/include/fastdds/rtps/common/Locator.hpp +++ b/include/fastdds/rtps/common/Locator.hpp @@ -452,48 +452,52 @@ inline std::istream& operator >>( else { kind = LOCATOR_KIND_INVALID; + loc.kind = LOCATOR_KIND_INVALID; } - // Get chars :[ - input >> punct >> punct; + if (kind != LOCATOR_KIND_INVALID) + { + // Get chars :[ + input >> punct >> punct; - // Get address in string - input.get(sb_address, ']'); - address = sb_address.str(); + // Get address in string + input.get(sb_address, ']'); + address = sb_address.str(); - // check if this is a valid IPv4 or IPv6 and call DNS if not - if ((kind == LOCATOR_KIND_UDPv4 || kind == LOCATOR_KIND_TCPv4) && - !IPLocator::isIPv4(address)) - { - auto addresses = IPLocator::resolveNameDNS(address); - if (addresses.first.empty()) + // check if this is a valid IPv4 or IPv6 and call DNS if not + if ((kind == LOCATOR_KIND_UDPv4 || kind == LOCATOR_KIND_TCPv4) && + !IPLocator::isIPv4(address)) { - loc.kind = LOCATOR_KIND_INVALID; - EPROSIMA_LOG_WARNING(LOCATOR, "Error deserializing Locator"); - return input; + auto addresses = IPLocator::resolveNameDNS(address); + if (addresses.first.empty()) + { + loc.kind = LOCATOR_KIND_INVALID; + EPROSIMA_LOG_WARNING(LOCATOR, "Error deserializing Locator"); + return input; + } + address = *addresses.first.begin(); } - address = *addresses.first.begin(); - } - if ((kind == LOCATOR_KIND_UDPv6 || kind == LOCATOR_KIND_TCPv6) && - !IPLocator::isIPv6(address)) - { - auto addresses = IPLocator::resolveNameDNS(address); - if (addresses.second.empty()) + if ((kind == LOCATOR_KIND_UDPv6 || kind == LOCATOR_KIND_TCPv6) && + !IPLocator::isIPv6(address)) { - loc.kind = LOCATOR_KIND_INVALID; - EPROSIMA_LOG_WARNING(LOCATOR, "Error deserializing Locator"); - return input; + auto addresses = IPLocator::resolveNameDNS(address); + if (addresses.second.empty()) + { + loc.kind = LOCATOR_KIND_INVALID; + EPROSIMA_LOG_WARNING(LOCATOR, "Error deserializing Locator"); + return input; + } + address = *addresses.second.begin(); } - address = *addresses.second.begin(); - } - // Get char ]: - input >> punct >> punct; + // Get char ]: + input >> punct >> punct; - // Get port - input >> port; + // Get port + input >> port; - IPLocator::createLocator(kind, address, port, loc); + IPLocator::createLocator(kind, address, port, loc); + } } catch (std::ios_base::failure& ) { diff --git a/include/fastdds/rtps/common/LocatorList.hpp b/include/fastdds/rtps/common/LocatorList.hpp index a466f121d59..149eac8e10b 100644 --- a/include/fastdds/rtps/common/LocatorList.hpp +++ b/include/fastdds/rtps/common/LocatorList.hpp @@ -166,6 +166,13 @@ class LocatorList return false; } + /// Not equal to operator + FASTDDS_EXPORTED_API bool operator !=( + const LocatorList& locator_list) const + { + return !(*this == locator_list); + } + /** * @brief Return an iterator to the beginning. * diff --git a/include/fastdds/rtps/common/LocatorSelectorEntry.hpp b/include/fastdds/rtps/common/LocatorSelectorEntry.hpp index abe08d666b4..bfcd8e7f415 100644 --- a/include/fastdds/rtps/common/LocatorSelectorEntry.hpp +++ b/include/fastdds/rtps/common/LocatorSelectorEntry.hpp @@ -123,6 +123,14 @@ struct LocatorSelectorEntry return entry; } + static LocatorSelectorEntry create_fully_selected_entry( + const LocatorList_t& unicast_locators) + { + // Use previous overload with an empty multicast list + LocatorList_t empty_list {}; + return create_fully_selected_entry(unicast_locators, empty_list); + } + //! GUID of the remote entity. GUID_t remote_guid; //! List of unicast locators to send data to the remote entity. diff --git a/include/fastdds/rtps/common/RemoteLocators.hpp b/include/fastdds/rtps/common/RemoteLocators.hpp index 8a06a223f9d..526977def89 100644 --- a/include/fastdds/rtps/common/RemoteLocators.hpp +++ b/include/fastdds/rtps/common/RemoteLocators.hpp @@ -193,6 +193,7 @@ inline std::istream& operator >>( if (letter == 'M') { input.get(sb_aux, '['); + input >> punct; // Read every locator while (punct != ']') @@ -207,6 +208,7 @@ inline std::istream& operator >>( if (letter == 'U') { + input.get(sb_aux, '['); input >> punct; // Read every locator diff --git a/include/fastdds/rtps/participant/RTPSParticipant.hpp b/include/fastdds/rtps/participant/RTPSParticipant.hpp index 8d37303823a..f797f4c6be5 100644 --- a/include/fastdds/rtps/participant/RTPSParticipant.hpp +++ b/include/fastdds/rtps/participant/RTPSParticipant.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp index c5bdc3a8c75..a416a605802 100644 --- a/include/fastdds/statistics/dds/domain/DomainParticipant.hpp +++ b/include/fastdds/statistics/dds/domain/DomainParticipant.hpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace eprosima { namespace fastdds { diff --git a/resources/xsd/fastdds_profiles.xsd b/resources/xsd/fastdds_profiles.xsd index e85067db314..5b4409368ce 100644 --- a/resources/xsd/fastdds_profiles.xsd +++ b/resources/xsd/fastdds_profiles.xsd @@ -740,11 +740,7 @@