I am trying to create the simplest C# application that will allow me to get the topics currently available in the selected DDS domain. But I can't seem to make it work.
// Create the DDS Domain participant on domain ID 0
DDS.DomainParticipant participant =
DDS.DomainParticipantFactory.get_instance().create_participant(
0,
DDS.DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT,
null, /* Listener */
DDS.StatusMask.STATUS_MASK_NONE);
DDS.Subscriber sub = participant.get_builtin_subscriber();
DDS.DataReader reader1 = sub.lookup_datareader("DCPSTopic");
DDS.TopicBuiltinTopicDataDataReader builtinReader1 =
(DDS.TopicBuiltinTopicDataDataReader)reader1;
DDS.TopicBuiltinTopicDataSeq topicSeq = new DDS.TopicBuiltinTopicDataSeq(10) ;
DDS.SampleInfoSeq infoSeq = new DDS.SampleInfoSeq(10);
builtinReader1.read(topicSeq,
infoSeq,
10,
DDS.SampleStateKind.ANY_SAMPLE_STATE,
DDS.ViewStateKind.ANY_VIEW_STATE,
DDS.InstanceStateKind.ANY_INSTANCE_STATE);
When running the code above, I get a "Retcode_NoData" exception in the last line (builtinReader1.read(...)) even though both publishers and subscribers are running and posting in the same domain (domain 0). Do you have any idea about what could be wrong with my code?
By the way. I use RTI Connext 5.0 implementation of DDS.
Regards John