diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp index 21f525bf221..cefce417707 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp @@ -312,18 +312,20 @@ SampleIdentity TypeLookupManager::get_types( ReturnCode_t TypeLookupManager::async_get_type( eprosima::ProxyPool::smart_ptr& temp_writer_data, + const fastdds::rtps::GUID_t& type_server, const AsyncGetTypeWriterCallback& callback) { return check_type_identifier_received( - temp_writer_data, callback, async_get_type_writer_callbacks_); + temp_writer_data, type_server, callback, async_get_type_writer_callbacks_); } ReturnCode_t TypeLookupManager::async_get_type( eprosima::ProxyPool::smart_ptr& temp_reader_data, + const fastdds::rtps::GUID_t& type_server, const AsyncGetTypeReaderCallback& callback) { return check_type_identifier_received( - temp_reader_data, callback, async_get_type_reader_callbacks_); + temp_reader_data, type_server, callback, async_get_type_reader_callbacks_); } TypeKind TypeLookupManager::get_type_kind_to_propagate() const @@ -346,6 +348,7 @@ TypeKind TypeLookupManager::get_type_kind_to_propagate() const template ReturnCode_t TypeLookupManager::check_type_identifier_received( typename eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const fastdds::rtps::GUID_t& type_server, const AsyncCallback& callback, std::unordered_maptype_information().type_information.complete().typeid_with_size() : temp_proxy_data->type_information().type_information.minimal().typeid_with_size(); - fastdds::rtps::GUID_t type_server = temp_proxy_data->guid(); // Check if the type is known if (fastdds::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer(). diff --git a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp index 196aeb94456..3b72c54320d 100644 --- a/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp +++ b/src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp @@ -180,6 +180,7 @@ class TypeLookupManager * Use builtin TypeLookup service to solve the type and dependencies of a given TypeInformation. * It receives a callback that will be used to notify when the negotiation is complete. * @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request. + * @param type_server[in] GUID of the remote participant that has the type. * @param callback Callback called when the negotiation is complete. * @return ReturnCode_t RETCODE_OK if the type is already known. * RETCODE_NO_DATA if type is not known, and a negotiation has been started. @@ -187,9 +188,11 @@ class TypeLookupManager */ ReturnCode_t async_get_type( eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const fastdds::rtps::GUID_t& type_server, const AsyncGetTypeWriterCallback& callback); ReturnCode_t async_get_type( eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const fastdds::rtps::GUID_t& type_server, const AsyncGetTypeReaderCallback& callback); /** @@ -205,6 +208,7 @@ class TypeLookupManager * Adds a callback to the async_get_type_callbacks_ entry of the TypeIdentfierWithSize, or creates a new one if * TypeIdentfierWithSize was not in the map before * @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request. + * @param type_server[in] GUID of the remote participant that has the type. * @param callback[in] Callback to add. * @param async_get_type_callbacks[in] The collection ProxyData and their callbacks to use. * @return ReturnCode_t RETCODE_OK if type is known. @@ -214,6 +218,7 @@ class TypeLookupManager template ReturnCode_t check_type_identifier_received( typename eprosima::ProxyPool::smart_ptr& temp_proxy_data, + const fastdds::rtps::GUID_t& type_server, const AsyncCallback& callback, std::unordered_mapmp_RTPSParticipant->network_factory(); CDRMessage_t tempMsg(change->serializedPayload); auto temp_writer_data = edp->get_temporary_writer_proxies_pool().get(); + const auto type_server = change->writerGUID; if (temp_writer_data->readFromCDRMessage(&tempMsg, network, edp->mp_RTPSParticipant->has_shm_transport(), true, change->vendor_id)) @@ -141,6 +142,7 @@ void EDPBasePUBListener::add_writer_from_change( { typelookup_manager->async_get_type( temp_writer_data, + type_server, after_typelookup_callback); } // If TypeInformation does not exist, try fallback mechanism @@ -216,6 +218,7 @@ void EDPBaseSUBListener::add_reader_from_change( const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory(); CDRMessage_t tempMsg(change->serializedPayload); auto temp_reader_data = edp->get_temporary_reader_proxies_pool().get(); + const auto type_server = change->writerGUID; if (temp_reader_data->readFromCDRMessage(&tempMsg, network, edp->mp_RTPSParticipant->has_shm_transport(), true, change->vendor_id)) @@ -285,6 +288,7 @@ void EDPBaseSUBListener::add_reader_from_change( { typelookup_manager->async_get_type( temp_reader_data, + type_server, after_typelookup_callback); } // If TypeInformation does not exist, try fallback mechanism diff --git a/versions.md b/versions.md index 0ca525af25d..04e6d83f82c 100644 --- a/versions.md +++ b/versions.md @@ -96,6 +96,8 @@ Forthcoming * Servers only redirect discovery information of their direct clients. * Remote Discovery servers connection list can now be updated and modified at runtime without restrictions. * Fast DDS CLI has been updated to allow the creation of servers without GUID. + * Servers are responsible of answering TypeLookupRequests of others servers when working with X-Types. + * Backup server is not compatible with X-Types. * Refactor in XML Parser to return DynamicTypeBuilder instead of DynamicType * Setting vendor_id in the received CacheChange_t for Data and DataFrag. * Added new DynamicData to JSON serializer (`json_serialize`).