Missing Last samples

3 posts / 0 new
Last post
Offline
Last seen: 2 weeks 3 hours ago
Joined: 01/13/2016
Posts: 58
Missing Last samples

Hi everyone,

       I have two programs, one is a publiser(A), the other is  a subscriber(B). the QOS is configured like this:

topic_qos.reliability.kind = DDS_RELIABLE_RELIABILITY_QOS;

datawriter_qos.writer_data_lifecycle.autodispose_unregistered_instances = TRUE;
datawriter_qos.durability.kind = DDS_VOLATILE_DURABILITY_QOS;
datawriter_qos.history.kind = DDS_KEEP_LAST_HISTORY_QOS;
datawriter_qos.history.depth = 1;
datawriter_qos.resource_limits.max_samples_per_instance = 100;
datawriter_qos.destination_order.kind = DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;

datareader_qos.durability.kind = DDS_VOLATILE_DURABILITY_QOS;
datareader_qos.history.kind = DDS_KEEP_LAST_HISTORY_QOS;
datareader_qos.history.depth = 1;
datareader_qos.resource_limits.max_samples_per_instance = 100;
datareader_qos.destination_order.kind = DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS;

         A is keeping receive datas from B.

        After B send last sample, it shut down, and A can not receive the last sample from  B, why?

Gerardo Pardo's picture
Offline
Last seen: 4 weeks 10 hours ago
Joined: 06/02/2010
Posts: 601

Does this happen always or only sometimes?

This could be a timing issue if you shut down  B immediately after witing the last sample. It may be that the application terminates before the sample is sent to the network, or if it is sent but somehow dropped the reliability protocol has no chance to repair it before B is shut down.

You can try waiting a bit after writing the last sample. Or alternatively call wait_for_acknowledgements() on the DataWriter to ensure the last sample is received before shutting down B.

Gerardo

Offline
Last seen: 2 weeks 3 hours ago
Joined: 01/13/2016
Posts: 58

thanks for your reply, i do as you tell, and it works good