The DataWriter’s wait_for_acknowledgments() operation blocks the calling thread until either all data written by the reliable DataWriter is acknowledged by (a) all reliable DataReaders that are matched and alive and (b) by all required subscriptions (see 7.3.13 Required Subscriptions), or until the duration specified by the max_wait parameter elapses, whichever happens first.
Note that if a thread is blocked in the call to wait_for_acknowledgments() on a DataWriter and a different thread writes new DDS samples on the same DataWriter, the new DDS samples must be acknowledged before unblocking the thread waiting on wait_for_acknowledgments().
DDS_ReturnCode_t wait_for_acknowledgments ( const DDS_Duration_t & max_wait)
This operation returns DDS_RETCODE_OK if all the DDS samples were acknowledged, or DDS_RETCODE_TIMEOUT if the max_wait duration expired first.
If the DataWriter does not have its 7.5.21 RELIABILITY QosPolicy kind set to RELIABLE, the operation will immediately return DDS_RETCODE_OK.
There is a similar operation available at the Publisher level, see 7.2.7 Waiting for Acknowledgments in a Publisher.
The reliability protocol used by Connext DDS is discussed in 11. Reliable Communications. The application acknowledgment mechanism is discussed in 7.3.12 Application Acknowledgment and 14. Guaranteed Delivery of Data.
© 2020 RTI