Skip to content

Commit 1acbb4d

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

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,8 +8129,19 @@ 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;
8135+
ret = replier->send_reply(reply_data, received_request_info);
8136+
if (RETCODE_OK != ret)
8137+
{
8138+
// Error
8139+
return;
8140+
}
8141+
8142+
// Send a Reply with the received related_sample_identity, indicating it is the last one.
8143+
void* reply_data = reply_type_support->create_data();
8144+
received_request_info.has_more_replies = false;
81308145
ret = replier->send_reply(reply_data, received_request_info);
81318146
if (RETCODE_OK != ret)
81328147
{

0 commit comments

Comments
 (0)