| 2052 | } |
| 2053 | |
| 2054 | void routing_manager_client::cleanup_client(client_t _client, bool _due_to_error) { |
| 2055 | |
| 2056 | if (_client != VSOMEIP_ROUTING_CLIENT) { |
| 2057 | VSOMEIP_INFO_P << "self 0x" << hex4(get_client()) << " handles cleanup of client 0x" << hex4(_client) << ", not reconnecting"; |
| 2058 | |
| 2059 | // First ensure that the connection is dropped, before enforcing a |
| 2060 | // reconnect from the client. Otherwise a client subscribe might |
| 2061 | // be handled by a partially cleaned-up connection |
| 2062 | std::set<protocol::service> requested_services; |
| 2063 | remove_local(_due_to_error, _client, requested_services); |
| 2064 | |
| 2065 | // Request the host these services again. |
| 2066 | if (_due_to_error) { |
| 2067 | if (auto state = state_machine_->state(); state == routing_client_state_e::ST_REGISTERED) { |
| 2068 | send_request_services(requested_services); |
| 2069 | } |
| 2070 | } |
| 2071 | |
| 2072 | } else { |
| 2073 | { |
| 2074 | std::scoped_lock its_lock{sender_mutex_}; |
| 2075 | if (sender_) { |
| 2076 | sender_->stop(_due_to_error); |
| 2077 | sender_ = nullptr; |
| 2078 | sender_cv_.notify_one(); |
| 2079 | } |
| 2080 | if (!_due_to_error) { |
| 2081 | VSOMEIP_INFO_P << "self 0x" << hex4(get_client()) << " handles shutdown. Not reconnecting to host 0x" << hex4(_client); |
| 2082 | return; |
| 2083 | } |
| 2084 | } |
| 2085 | VSOMEIP_INFO_P << "self 0x" << hex4(get_client()) << " handles cleanup of host 0x" << hex4(_client) << ", will reconnect"; |
| 2086 | reconnect(); |
| 2087 | } |
| 2088 | } |
| 2089 | |
| 2090 | void routing_manager_client::send_get_offered_services_info(client_t _client, offer_type_e _offer_type) { |
| 2091 |
no test coverage detected