get_publishers use

4 posts / 0 new
Last post
Offline
Last seen: 11 years 3 months ago
Joined: 07/19/2013
Posts: 2
get_publishers use

Hello,

 

I try to use get_publishers() in java in order to retreive my existing publisher but I got an error RETCODE_BAD_PARAMETER : null argument...

Does anybody has an example with a correct call of this method ?


Thanks.

Patrick

Organization:
gianpiero's picture
Offline
Last seen: 9 months 3 weeks ago
Joined: 06/02/2010
Posts: 177

Hello Patrick, 

I just added an example on how to use the get_publishers() API. 

Here a snippet:

...
 PublisherSeq publisherSeq = new PublisherSeq();
 participant.get_publishers(publisherSeq);

 System.out.println("I found " + publisherSeq.size() + "publishers");

 for (int i = 0; i < publisherSeq.size(); i++) {
     Publisher tmp = (Publisher) publisherSeq.get(i);
     System.out.println("The " + i + " publisher I found is " + tmp);
 }
... 

 

You can also download the full example for c++ and java here.

Best,
 Gianpiero

Offline
Last seen: 11 years 3 months ago
Joined: 07/19/2013
Posts: 2

Hello Gianpiero,


Thanks, it works. I just do a beginner (indeed, I am a beginner in java) error in the declaration of my publisher sequence.

Regards.

gianpiero's picture
Offline
Last seen: 9 months 3 weeks ago
Joined: 06/02/2010
Posts: 177

Hi Patrick,

I'm glad I could help, let me know if you have more questions.

Regards,
  Gianpiero