31.11 Waiting for Acknowledgments in a DataWriter

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 31.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 47.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 30.7 Waiting for Acknowledgments in a Publisher.

The reliability protocol used by Connext is discussed in 32. Reliability Models for Sending Data. The application acknowledgment mechanism is discussed in 31.12 Application Acknowledgment and 33. Guaranteed Delivery of Data.