Detect connection drop or closed application

2 posts / 0 new
Last post
Last seen: 6 years 5 months ago
Joined: 08/21/2014
Posts: 1
Detect connection drop or closed application

Using the ParticipantBuiltinTopicDataDataReader, I've managed to get notifcations for whenever a participant joins a domain, or leaves gracefully(i.e, shutdowns).

Is there a way to get noitfied when a participant drops unexpectently? I.e. network damage or application crashing?

I have automatic liveliness turned on in the qos settings and I've set the heartbeat period to three seconds. I've also overriden the on_liveliness_changed method, although this never gets called.

gianpiero's picture
Last seen: 2 weeks 3 days ago
Joined: 06/02/2010
Posts: 175


did you set the right mask when you create the participant? The on_liveliness_changed should be called.. 

participant  = DDSDomainParticipantFactory::get_instance()->create_participant(                         
                                                                        domainId, // Domain ID
                                                                        participant_qos,  // QoS
                                                                        participant_listener, // Listener
                                                                        DDS_LIVELINESS_LOST_STATUS | DDS_LIVELINESS_CHANGED_STATUS); // Listener Mask

For more info check this forum post

Let me know if this solves your problem!