eProsima / Micro-XRCE-DDS

An XRCE DDS implementation. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
156 stars 17 forks source link

what pair a requester and a replier #83

Closed vibnwis closed 3 years ago

vibnwis commented 3 years ago

I am trying to send a request to the replier, and the replier only replies to the requester. I have changed to mismatch replier and the requester to uxr_object_id(0x02, UXR_REPLIER_ID) and uxr_object_id(0x01, UXR_REQUESTER_ID) respectively. From the test, the requester and the replier still work. Does XRCE-DDS work that way?

Thank you V

pablogs9 commented 3 years ago

https://micro-xrce-dds.docs.eprosima.com/en/latest/getting_started.html?highlight=requester#requester-replier

vibnwis commented 3 years ago

Many thanks for that. Actually, I have read that and my interpretation is a requester-replier pair is formed by the uxr_object_id which both are set 0x01. However, obviously, I was wrong. Is it the "service_name" in XML? Any comments or suggestions?

vibnwis commented 3 years ago

I modified the participant ID 0x01 to 0x02. The requester and the replier still works. Again I was wrong about the one participant and many publishers and subscribers. How do we create two separate systems with XRCE_DDS in a computer system?

vibnwis commented 3 years ago

I changed the code to 0x02 and added _2


// Create entities participant_id = uxr_object_id(0x02, UXR_PARTICIPANT_ID); const char* participant_xml = "" "" "" "default_xrce_participant" "" "" ""; uint16_t participant_req = uxr_buffer_create_participant_xml(&session, reliable_out, participant_id, 0, participant_xml, UXR_REPLACE);

replier_id = uxr_object_id(0x02, UXR_REPLIER_ID);
const char* replier_xml = "<dds>"
        "<replier profile_name=\"my_requester\""
        "service_name=\"service_name\""
        "request_type=\"request_type_2\""
        "reply_type=\"reply_type_2\">"
        "</replier>"
        "</dds>";

Now the requester not receiving any replies, but the replier still receives the request and sending out the reply.

vibnwis commented 3 years ago

My intention is to send a request to the replier, and the replier only replies to the requester. Can I achieve that in XRCE_DDS?

vibnwis commented 3 years ago

uxr_object_id is used for creating participant_id, requester or replier_id. What do they mean from the DDS perspective? I have changed the values to mismatch with the "publisher". However, my tests show that they still work. Appreciate your comments or suggestions!

Thank you