| 971 | } |
| 972 | |
| 973 | bool routing_manager_impl::offer_service_remotely(service_t _service, instance_t _instance, std::uint16_t _port, bool _reliable, |
| 974 | bool _magic_cookies_enabled) { |
| 975 | bool ret = true; |
| 976 | |
| 977 | if (!is_locally_available(_service, _instance, ANY_MAJOR)) { |
| 978 | VSOMEIP_ERROR_P << "Service [" << hex4(_service) << "." << hex4(_instance) << "] is not offered locally! Won't offer it remotely."; |
| 979 | ret = false; |
| 980 | } else { |
| 981 | // update service info in configuration |
| 982 | if (!configuration_->remote_offer_info_add(_service, _instance, _port, _reliable, _magic_cookies_enabled)) { |
| 983 | ret = false; |
| 984 | } else { |
| 985 | // trigger event registration again to create shadow events |
| 986 | const client_t its_offering_client = find_local_client(_service, _instance); |
| 987 | if (its_offering_client == VSOMEIP_ROUTING_CLIENT) { |
| 988 | VSOMEIP_ERROR_P << "Didn't find offering client for service [" << hex4(_service) << "." << hex4(_instance) << "]"; |
| 989 | ret = false; |
| 990 | } else { |
| 991 | if (!stub_->send_provided_event_resend_request(its_offering_client, pending_remote_offer_add(_service, _instance))) { |
| 992 | VSOMEIP_ERROR_P << "Couldn't send event resend request to client 0x" << hex4(its_offering_client) |
| 993 | << " providing service [" << hex4(_service) << "." << hex4(_instance) << "]"; |
| 994 | |
| 995 | ret = false; |
| 996 | } |
| 997 | } |
| 998 | } |
| 999 | } |
| 1000 | return ret; |
| 1001 | } |
| 1002 | |
| 1003 | bool routing_manager_impl::stop_offer_service_remotely(service_t _service, instance_t _instance, std::uint16_t _port, bool _reliable, |
| 1004 | bool _magic_cookies_enabled) { |
no test coverage detected