Get Publishers


get_publishers() allows the application to access all the publishers the participant has.

Example Description

In this example we illustrate how call the get_publishers() API on a participant and how to iterate on the returned sequence and enumerate all the publishers.

First, we create two publishers. Then, we call the get_publishers() API. Finally we iterate through the returned sequence to print a reference to the publishers.

 PublisherSeq publisherSeq = new 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);

Download Example

Browse Example