Setting Up DataWriterListeners

DataWriters may optionally have Listeners. Listeners are essentially callback routines and provide the means for Connext DDS to notify your application of the occurrence of events (status changes) relevant to the DataWriter. For more general information on Listeners, see Listeners.

Note: Some operations cannot be used within a listener callback, see Restricted Operations in Listener Callbacks.

If you do not implement a DataWriterListener, the associated PublisherListener is used instead. If that Publisher also does not have a Listener, then the DomainParticipant’s Listener is used if one exists (see Setting Up PublisherListeners and Setting Up DomainParticipantListeners).

Listeners are typically set up when the DataWriter is created (see Publishers). You can also set one up after creation by using the set_listener() operation. Connext DDS will invoke a DataWriter’s Listener to report the status changes listed in DataWriterListener Callbacks (if the Listener is set up to handle the particular status, see Setting Up DataWriterListeners).

DataWriterListener Callbacks

This DataWriterListener callback...

... is triggered by ...

on_instance_replaced()

A replacement of an existing instance by a new instance; see Configuring DataWriter Instance Replacement

on_liveliness_lost

A change to LIVELINESS_LOST Status

on_offered_deadline_missed

A change to OFFERED_DEADLINE_MISSED Status

on_offered_incompatible_qos

A change to OFFERED_INCOMPATIBLE_QOS Status

on_publication_matched

A change to PUBLICATION_MATCHED Status

on_reliable_writer_cache_changed

A change to RELIABLE_WRITER_CACHE_CHANGED Status (DDS Extension)

on_reliable_reader_activity_changed

A change to RELIABLE_READER_ACTIVITY_CHANGED Status (DDS Extension)

on_service_request_accepted

A change to SERVICE_REQUEST_ACCEPTED Status (DDS Extension).

© 2018 RTI