Skip to content

Commit a62e175

Browse files
committed
Refs #23365. Update example code.
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 0d6ee4a commit a62e175

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

code/DDSCodeTester.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8045,6 +8045,10 @@ void rpcdds_internal_api_examples()
80458045
if (expected_request_info.related_sample_identity == received_request_info.related_sample_identity)
80468046
{
80478047
// Received Reply sample is associated to the sent Request sample
8048+
if (received_request_info.has_more_replies)
8049+
{
8050+
// More replies for the same request will be received
8051+
}
80488052
}
80498053

80508054
// Delete created Requester
@@ -8125,15 +8129,26 @@ void rpcdds_internal_api_examples()
81258129

81268130
// ... Process received data
81278131

8128-
// Send a Reply with the received related_sample_identity
8132+
// Send a Reply with the received related_sample_identity, indicating there will be more replies.
81298133
void* reply_data = reply_type_support->create_data();
8134+
received_request_info.has_more_replies = true;
81308135
ret = replier->send_reply(reply_data, received_request_info);
81318136
if (RETCODE_OK != ret)
81328137
{
81338138
// Error
81348139
return;
81358140
}
81368141

8142+
// Send a Reply with the received related_sample_identity, indicating it is the last one.
8143+
void* reply_data_2 = reply_type_support->create_data();
8144+
received_request_info.has_more_replies = false;
8145+
ret = replier->send_reply(reply_data_2, received_request_info);
8146+
if (RETCODE_OK != ret)
8147+
{
8148+
// Error
8149+
return;
8150+
}
8151+
81378152
/* Delete created Replier */
81388153
ret = participant->delete_service_replier(replier->get_service_name(), replier);
81398154
if (RETCODE_OK != ret)

0 commit comments

Comments
 (0)