You are here: Part 2: Core Concepts > Receiving Data > Subscribers > Statuses for Subscribers

Statuses for Subscribers

The status indicators for a Subscriber are the same as those available for its DataReaders, with one additional status: DATA_ON_READERS (DATA_ON_READERS Status). The following statuses can be monitored by the SubscriberListener.

You can access Subscriber status by using a SubscriberListener or its inherited get_status_changes() operation (see Getting Status and Status Changes), which can be used to explicitly poll for the DATA_ON_READERS status of the Subscriber.

DATA_ON_READERS Status

The DATA_ON_READERS status, like the DATA_AVAILABLE status for DataReaders, is a read communication status, which makes it somewhat different from other plain communication statuses. (See Types of Communication Status for more information on statuses and the difference between read and plain statuses.) In particular, there is no status-specific data structure; the status is either changed or not, there is no additional associated information.

The DATA_ON_READERS status indicates that there is new data available for one or more DataReaders that belong to this Subscriber. The DATA_AVAILABLE status for each such DataReader will also be updated.

The DATA_ON_READERS status is reset (the corresponding bit in the bitmask is turned off) when you call read(), take(), or one of their variations on any of the DataReaders that belong to the Subscriber. This is true even if the DataReader on which you call read/take is not the same DataReader that caused the DATA_ON_READERS status to be set in the first place. This status is also reset when you call notify_datareaders() on the Subscriber, or after on_data_on_readers() is invoked.

If a SubscriberListener has both on_data_on_readers() and on_data_available() callbacks enabled (by turning on both status bits), only on_data_on_readers() is called.

© 2016 RTI