register_type failing

2 posts / 0 new
Last post
Offline
Last seen: 5 years 3 days ago
Joined: 09/06/2018
Posts: 22
register_type failing

Hi,

We are using RHEL7.5, traditional C++ API, and RTI DDS v5.3.1.

Our application is composed of multiple shared libraries.  Each shared library shares a common topic.  Our applicaiton also consists of a single domain participant.  I'm seeing a problem wrt to the use of register_type.

Each shared library calls register_type using the same type and topic.  This works when the first shared library is loaded.  This does not work when additional shared libraries are loaded; We are seeing register_type return DDS_RETCODE_PRECONDITION_NOT_MET. Our workaround is to make sure we only call register_type once.  We would rather not do this so these shared libraries can be used with our applicatoins without recompile.

We expected that calling register_type would work if called with the same type and topic that were already registered because of this statement in the docs wrt to FooTypeSupport::register_type:

The same DDSTypeSupport can be registered multiple times with a DDSDomainParticipant using the same or different values for the type_name. If register_type is called multiple times on the same DDSTypeSupport with the same DDSDomainParticipant and type_name, the second (and subsequent) registrations are ignored but the operation returns DDS_RETCODE_OK.

https://community.rti.com/static/documentation/connext-dds/5.3.1/doc/api/connext_dds/api_cpp/structFooTypeSupport.html#a25b70f0c36cbb4ba95e6ef08e094e84c

 

is this statement wrong? Or is there somethign special that must be done with shared libraries to get this functionality above?

 

tia,be

 

Offline
Last seen: 3 months 1 week ago
Joined: 02/11/2016
Posts: 144

I'm guessing your issue stems from:

Cannot use the same type_name to register two different DDSTypeSupport with the same DDSDomainParticipant, or else the operation will fail and DDS_RETCODE_PRECONDITION_NOT_MET will be returned.

Good luck.