27.1 Ignoring Specific Remote DomainParticipants

The ignore_participant() operation is used to instruct Connext to locally ignore a remote DomainParticipant. It causes Connext to locally behave as if the remote DomainParticipant does not exist.

DDS_ReturnCode_t ignore_participant  (const DDS_InstanceHandle_t &  handle)

After invoking this operation, Connext will locally ignore any Topic, publication, or subscription that originates on that DomainParticipant. (If you only want to ignore specific publications or subscriptions, see 27.2 Ignoring Publications and Subscriptions instead.) Figure 27.1: Ignoring Participants provides an example.

By default, the maximum number of participants that can be ignored is limited by ignored_entity_allocation.max_count in the 44.4 DOMAIN_PARTICIPANT_RESOURCE_LIMITS QosPolicy (DDS Extension). However, that behavior can be changed by using ignore_entity_replacement_kind in the same QoS policy.

See also: 27.4 Resource Limits Considerations for Ignored Entities.

Caution: There is no way to reverse this operation. You can add to the peer list, however—see 44.2.3 Adding and Removing Peers List Entries.

Figure 27.1: Ignoring Participants

class MyParticipantBuiltinTopicDataListener :
public DDSDataReaderListener {
	public:
		virtual void on_data_available(DDSDataReader *reader);
		// ......
};
void MyParticipantBuiltinTopicdataListener::on_data_available(
	DDSDataReader *reader) {
	DDSParticipantBuiltinTopicDataDataReader 
		*builtinTopicDataReader =
		DDSParticipantBuiltinTopicDataDataReader *) reader;
	DDS_ParticipantBuiltinTopicDataSeq data_seq;
	DDS_SampleInfoSeq info_seq;
	int = 0;
	if (builtinTopicDataReader->take(data_seq, info_seq,
		DDS_LENGTH_UNLIMITED, DDS_ANY_SAMPLE_STATE,
		DDS_ANY_VIEW_STATE, DDS_ANY_INSTANCE_STATE) != 
		DDS_RETCODE_OK){
		// ... error
	}
	for (i = 0; i < data_seq.length(); ++i) {
		if (info_seq[i].valid_data) {
		    // check user_data for access control
		    if (data_seq[i].user_data[0] != 0x9) {
			if (builtinTopicDataReader->get_subscriber()
				->get_participant()
				->ignore_participant(
				info_seq[i].instance_handle)
				!= DDS_RETCODE_OK) {
				// ... error
			}
		    }
		}
	}
	if (builtinTopicDataReader->return_loan(
		data_seq, info_seq) != DDS_RETCODE_OK) {
		// ... error
	}
}