Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve vsomeip sluggish connect (master 3.4.x branch) #670

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 4 additions & 30 deletions implementation/endpoints/src/server_endpoint_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,50 +300,24 @@ bool server_endpoint_impl<Protocol>::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<service_t, method_t> its_identifier
= std::make_pair(its_service, its_method);
if (its_data.train_->passengers_.empty()) {
its_data.train_->departure_ = its_now + its_retention;
} else {
if (its_data.train_->passengers_.end()
!= its_data.train_->passengers_.find(its_identifier)) {
must_depart = true;
} else {
// STEP 5: Check whether the current message fits into the current train
if (its_data.train_->buffer_->size() + _size > endpoint_impl<Protocol>::max_message_size_) {
must_depart = true;
} else {
// STEP 6: Check debouncing time
if (its_debouncing > its_data.train_->minimal_max_retention_time_) {
// train's latest departure would already undershot new
// passenger's debounce time
must_depart = true;
} else {
if (its_now + its_debouncing > its_data.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 < its_data.train_->minimal_debounce_time_) {
// train's earliest departure would already exceed
// the new passenger's retention time.
must_depart = true;
} else {
if (its_now + its_retention < its_data.train_->departure_) {
its_data.train_->departure_ = its_now + its_retention;
}
}
if (its_now + its_retention < its_data.train_->departure_) {
its_data.train_->departure_ = its_now + its_retention;
}
}

}
}
}

// STEP 8: if necessary, send current buffer and create a new one
Expand Down
5 changes: 2 additions & 3 deletions implementation/endpoints/src/udp_server_endpoint_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,8 @@ void udp_server_endpoint_impl::on_message_received(
its_remote_address, its_remote_port);
}
} else {
if (its_service != VSOMEIP_SD_SERVICE ||
(current_message_size > VSOMEIP_SOMEIP_HEADER_SIZE &&
current_message_size >= remaining_bytes)) {
if (current_message_size > VSOMEIP_SOMEIP_HEADER_SIZE &&
remaining_bytes >= 0) {
its_host->on_message(&_buffer[i],
current_message_size, this, _is_multicast,
VSOMEIP_ROUTING_CLIENT,
Expand Down