What is the best way to get the topic name of a DataWriter that is leaving the domain.
I am currently subscribing to the topic
_builtinPublicationReader = (DDSPublicationBuiltinTopicDataDataReader*)builtinSubscriber->lookup_datareader(DDS_PUBLICATION_TOPIC_NAME);
if(_builtinPublicationReader == NULL)
{
std::cerr <<; "Unable to retreive built-in Publication Reader." << std::endl;
return false;
}
The on_data_avaiable function is being called, but SampleInfo.valid_data if false and not TopicData is available. I understand this is the expected behavior. So, what is the best way to get the topic name? I have tried to use the publication instance handle that is provided in the SampleInfo, but I get the following error, DDS_DomainParticipant_get_publication_data:ERROR: Bad parameter: publication_handle.