Hi,
I need to create a DomaniParticipant with TransportMulticastMappingQoS set programmaticaly (C++), but unfortunately I've found no such code in RTI examples area.
According to Users Manual, I shoud fill a DDS_TransportMulticastMappingQosPolicy struct which is defined in dds_c_infrastructure.h like:
struct DDS_TransportMulticastMappingQosPolicy {
/*e \dref_TransportMulticastMappingQosPolicy_value
*/
struct DDS_TransportMulticastMappingSeq value;
DDSCPP_VARIABLE_LENGTH_VALUE_TYPE_SUPPORT(DDS_TransportMulticastMappingQosPolicy)
};
Where:
DDS_SEQUENCE(DDS_TransportMulticastMappingSeq, struct DDS_TransportMulticastMapping_t);
And:
struct DDS_TransportMulticastMapping_t {
/*e \dref_TransportMulticastMapping_t_addresses
*/
char* addresses;
/*e \dref_TransportMulticastMapping_t_topic_expression
*/
char* topic_expression;
/*e \dref_TransportMulticastMapping_t_mapping_function
*/
struct DDS_TransportMulticastMappingFunction_t mapping_function;
DDSCPP_VARIABLE_LENGTH_VALUE_TYPE_SUPPORT(DDS_TransportMulticastMapping_t)
};
I am plannig to use a Multicast QoS topic map similar to:
Topic Name (topic_expression field above) Multicast Add (addresses field above) Port (???)
------------------------------------------------------------------------------------------------------------------------------------------------
"ind.any.*" "224.0.0.1" 600
"nor.sys.*" "224.0.0.2" 601
"ade.sys.*" "224.0.0.3" 602
Does anyone have a piece of code that implemments this TransportMulticastMappingQoS for a C++ compiler?
How to add a port number to IP addresses expressions? (I could not find it out in Section 8.5.8.1 of Users Manual) Is it like "IP:PORT" definition?
Thanks in advance!
Julio.
Hello Julio,
You are right. We don't have examples for that. And we should: hopefully we will have them up soon.
Let me see if I can help you with some code snippets.
Before doing anything get the participant QoS and set two lists of adresses: One for topics starting with F and one for topic starting with B:
At this point create your participant using the participantQoS you just initialized.
The dataReader qos, by default has datareaderQos.multicast.value = DDS_AUTOMATIC_TRANSPORT_MULTICAST_QOS.
If datareaderQos.multicast.value is set to DDS_AUTOMATIC_TRANSPORT_MULTICAST_QOS (default) and the DDS_TransportMulticastQosPolicy::value has at least one element with an empty address, then the address will be obtained from DDS_TransportMulticastMappingQosPolicy!
Does it make more sense now?
I hope the code snippets will help you for now. Try it and feel free to post here for more info or help.
Best,
Gianpiero
Hi gianpiero,
Thanks for your response !!!!
I still have two questions with regard to your post:
1) In Participant QoS is there a way to define a set of MUTICAST ADDRESS+PORT(s) in Multicast Map or just sets of MULTICAST ADRESSES as your code shows?
2) The 2nd part of your post, when you set "tmp" variable you are actually changing datareaderQos ? Do we have to set datareaderQos in orther to have Multicast Map Participant QoS working ? I thought that we just needed to set Participant QoS in both sides (Publisher and Subscriber)...
Thanks again!
Julio.
Hello Julio,
Reguarding your first (1) question: I believe there is not way to set the port in the Multicast Map.
Reguarding your second (2) question: TODAY in order for the datareader to use the multicast address that is specified in the participant QoS, you have to specify an empty receive_address in the datareader multicast QoS. But we are addressing this issue for the next release (for future reference the issue number is CORE-6054).
I hope this helps you out.
Regards,
Gianpiero