MCPcopy Create free account
hub / github.com/COVESA/vsomeip / request_service

Method request_service

implementation/routing/src/routing_manager_client.cpp:367–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367void routing_manager_client::request_service([[maybe_unused]] client_t _client, service_t _service, instance_t _instance,
368 major_version_t _major, minor_version_t _minor) {
369
370 {
371 size_t request_debouncing_time = configuration_->get_request_debounce_time(host_->get_name());
372 protocol::service request = {_service, _instance, _major, _minor};
373 std::scoped_lock its_lock{consumer_mutex_};
374 if (requests_.contains(request) || requests_to_debounce_.contains(request)) {
375 return;
376 }
377 if (!request_debouncing_time) {
378 // order matters:
379 // 1. Ensure that the set contains this request
380 // 2. Try to send if we are registered
381 // If exchanged the sending after the registration is going to race with
382 // the subsequent logic.
383 requests_.insert(request);
384 if (state_machine_->state() == routing_client_state_e::ST_REGISTERED) {
385 std::set<protocol::service> requests;
386 requests.insert(request);
387 send_request_services(requests);
388 }
389 } else {
390 requests_to_debounce_.insert(request);
391 if (!request_debounce_timer_running_) {
392 request_debounce_timer_running_ = true;
393 request_debounce_timer_.expires_after(std::chrono::milliseconds(request_debouncing_time));
394 request_debounce_timer_.async_wait(std::bind(&routing_manager_client::request_debounce_timeout_cbk,
395 std::dynamic_pointer_cast<routing_manager_client>(shared_from_this()),
396 std::placeholders::_1));
397 }
398 }
399 }
400}
401
402void routing_manager_client::release_service(client_t _client, service_t _service, instance_t _instance) {
403 bool pending(false);

Callers

nothing calls this directly

Calls 7

insertMethod · 0.80
stateMethod · 0.80
get_nameMethod · 0.45
containsMethod · 0.45
expires_afterMethod · 0.45
async_waitMethod · 0.45

Tested by

no test coverage detected