Skip to content

Commit

Permalink
Take all available samples on service/client on_data_available. (#616)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MiguelCompany authored and mergify[bot] committed Jun 27, 2022
1 parent 1527f09 commit 7fe87c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ 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
<<<<<<< HEAD
if (sub->takeNextData(&data, &response.sample_info_)) {
if (eprosima::fastrtps::rtps::ALIVE == response.sample_info_.sampleKind) {
=======
while (reader->take_next_sample(&data, &response.sample_info_) == ReturnCode_t::RETCODE_OK) {
if (response.sample_info_.valid_data) {
>>>>>>> e9abdc4 (Take all available samples on service/client on_data_available. (#616))
response.sample_identity_ = response.sample_info_.related_sample_identity;

if (response.sample_identity_.writer_guid() == info_->reader_guid_ ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,13 @@ 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
<<<<<<< HEAD
if (sub->takeNextData(&data, &request.sample_info_)) {
if (eprosima::fastrtps::rtps::ALIVE == request.sample_info_.sampleKind) {
=======
while (reader->take_next_sample(&data, &request.sample_info_) == ReturnCode_t::RETCODE_OK) {
if (request.sample_info_.valid_data) {
>>>>>>> e9abdc4 (Take all available samples on service/client on_data_available. (#616))
request.sample_identity_ = request.sample_info_.sample_identity;
// Use response subscriber guid (on related_sample_identity) when present.
const eprosima::fastrtps::rtps::GUID_t & reader_guid =
Expand Down

0 comments on commit 7fe87c9

Please sign in to comment.