diff --git a/implementation/routing/src/routing_manager_impl.cpp b/implementation/routing/src/routing_manager_impl.cpp index 9d45c656a..f4ba96b8d 100644 --- a/implementation/routing/src/routing_manager_impl.cpp +++ b/implementation/routing/src/routing_manager_impl.cpp @@ -2698,6 +2698,8 @@ void routing_manager_impl::update_routing_info(std::chrono::milliseconds _elapse for (const auto &i : s.second) { if (discovery_) { discovery_->unsubscribe_all(s.first, i); + // go to Initial Wait Phase + discovery_->reset_request_sent_counter(s.first, i); } del_routing_info(s.first, i, true, true); VSOMEIP_INFO << "update_routing_info: elapsed=" << _elapsed.count() diff --git a/implementation/service_discovery/include/service_discovery.hpp b/implementation/service_discovery/include/service_discovery.hpp index 34a33f277..179533bcc 100644 --- a/implementation/service_discovery/include/service_discovery.hpp +++ b/implementation/service_discovery/include/service_discovery.hpp @@ -45,6 +45,7 @@ class service_discovery { eventgroup_t _eventgroup, client_t _client) = 0; virtual void unsubscribe_all(service_t _service, instance_t _instance) = 0; virtual void unsubscribe_all_on_suspend() = 0; + virtual void reset_request_sent_counter(service_t _service, instance_t _instance) = 0; virtual bool send(bool _is_announcing) = 0; diff --git a/implementation/service_discovery/include/service_discovery_impl.hpp b/implementation/service_discovery/include/service_discovery_impl.hpp index d07fcb1f7..1d70fb38a 100644 --- a/implementation/service_discovery/include/service_discovery_impl.hpp +++ b/implementation/service_discovery/include/service_discovery_impl.hpp @@ -82,6 +82,7 @@ class service_discovery_impl: public service_discovery, void unsubscribe_all(service_t _service, instance_t _instance); void unsubscribe_all_on_suspend(); void remove_subscriptions(service_t _service, instance_t _instance); + void reset_request_sent_counter(service_t _service, instance_t _instance); bool send(bool _is_announcing); diff --git a/implementation/service_discovery/src/service_discovery_impl.cpp b/implementation/service_discovery/src/service_discovery_impl.cpp index 768384b21..4b8309413 100644 --- a/implementation/service_discovery/src/service_discovery_impl.cpp +++ b/implementation/service_discovery/src/service_discovery_impl.cpp @@ -240,6 +240,18 @@ service_discovery_impl::release_service( } } +void +service_discovery_impl::reset_request_sent_counter(service_t _service, instance_t _instance) { + std::lock_guard its_lock(requested_mutex_); + auto find_service = requested_.find(_service); + if (find_service != requested_.end()) { + auto find_instance = find_service->second.find(_instance); + if (find_instance != find_service->second.end()) { + find_instance->second->set_sent_counter(0); + } + } +} + void service_discovery_impl::update_request(service_t _service, instance_t _instance) { std::lock_guard its_lock(requested_mutex_);