Skip to content

Commit

Permalink
Take all available samples on service/client on_data_available. (back…
Browse files Browse the repository at this point in the history
…port #616) (#623)

* Take all available samples on service/client on_data_available. (#616)

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit e9abdc4)

# Conflicts:
#	rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_client_info.hpp
#	rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/custom_service_info.hpp

* resolve merge conflicts.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
  • Loading branch information
3 people committed May 17, 2023
1 parent 069262f commit 3c2c5b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ClientListener : public eprosima::fastrtps::SubscriberListener
data.is_cdr_buffer = true;
data.data = response.buffer_.get();
data.impl = nullptr; // not used when is_cdr_buffer is true
if (sub->takeNextData(&data, &response.sample_info_)) {
while (sub->takeNextData(&data, &response.sample_info_)) {
if (eprosima::fastrtps::rtps::ALIVE == response.sample_info_.sampleKind) {
response.sample_identity_ = response.sample_info_.related_sample_identity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class ServiceListener : public eprosima::fastrtps::SubscriberListener
data.is_cdr_buffer = true;
data.data = request.buffer_;
data.impl = nullptr; // not used when is_cdr_buffer is true
if (sub->takeNextData(&data, &request.sample_info_)) {
while (sub->takeNextData(&data, &request.sample_info_)) {
if (eprosima::fastrtps::rtps::ALIVE == request.sample_info_.sampleKind) {
request.sample_identity_ = request.sample_info_.sample_identity;
// Use response subscriber guid (on related_sample_identity) when present.
Expand Down

0 comments on commit 3c2c5b3

Please sign in to comment.