diff --git a/implementation/endpoints/include/buffer.hpp b/implementation/endpoints/include/buffer.hpp index af0582d2e..56f31c31a 100644 --- a/implementation/endpoints/include/buffer.hpp +++ b/implementation/endpoints/include/buffer.hpp @@ -55,6 +55,9 @@ struct train { departure_ = departure_timer_->expires_from_now(); boost::system::error_code ec; departure_timer_->cancel(ec); + if (departure_.count() < 0) { + departure_ = std::chrono::nanoseconds::zero(); + } } }; diff --git a/implementation/endpoints/src/server_endpoint_impl.cpp b/implementation/endpoints/src/server_endpoint_impl.cpp index 90aea966b..b75605500 100644 --- a/implementation/endpoints/src/server_endpoint_impl.cpp +++ b/implementation/endpoints/src/server_endpoint_impl.cpp @@ -297,10 +297,8 @@ bool server_endpoint_impl::send_intern( _data[VSOMEIP_METHOD_POS_MAX]); std::chrono::nanoseconds its_debouncing(0), its_retention(0); - if (its_service != VSOMEIP_SD_SERVICE && its_method != VSOMEIP_SD_METHOD) { - get_configured_times_from_endpoint(its_service, its_method, + get_configured_times_from_endpoint(its_service, its_method, &its_debouncing, &its_retention); - } // STEP 4: Check if the passenger enters an empty train const std::pair its_identifier = std::make_pair( @@ -308,39 +306,14 @@ bool server_endpoint_impl::send_intern( if (target_train->passengers_.empty()) { target_train->departure_ = its_retention; } else { - if (target_train->passengers_.end() - != target_train->passengers_.find(its_identifier)) { - must_depart = true; - } else { // STEP 5: Check whether the current message fits into the current train if (target_train->buffer_->size() + _size > endpoint_impl::max_message_size_) { must_depart = true; } else { - // STEP 6: Check debouncing time - if (its_debouncing > target_train->minimal_max_retention_time_) { - // train's latest departure would already undershot new - // passenger's debounce time - must_depart = true; - } else { - if (its_debouncing > target_train->departure_) { - // train departs earlier as the new passenger's debounce - // time allows - must_depart = true; - } else { - // STEP 7: Check maximum retention time - if (its_retention < target_train->minimal_debounce_time_) { - // train's earliest departure would already exceed - // the new passenger's retention time. - must_depart = true; - } else { - if (its_retention < target_train->departure_) { - target_train->departure_ = its_retention; - } - } + if (its_retention < target_train->departure_) { + target_train->departure_ = its_retention; } - } } - } } // STEP 8: if necessary, send current buffer and create a new one