| 838 | } |
| 839 | |
| 840 | void application_impl::send(std::shared_ptr<message> _message) { |
| 841 | |
| 842 | // likely that the user created a message (with `runtime::create_message`) and forgot to set the type |
| 843 | // fail here in an obvious way, instead of down-the-line in some client-lookup code |
| 844 | if (_message->get_message_type() == message_type_e::MT_UNKNOWN) { |
| 845 | VSOMEIP_ERROR_P << "Message [" << hex4(_message->get_service()) << "." << hex4(_message->get_instance()) << "." |
| 846 | << hex4(_message->get_method()) << "] has unknown type, cannot send!"; |
| 847 | return; |
| 848 | } |
| 849 | |
| 850 | bool is_request = utility::is_request(_message); |
| 851 | if (client_side_logging_ |
| 852 | && (client_side_logging_filter_.empty() |
| 853 | || (1 == client_side_logging_filter_.count(std::make_tuple(_message->get_service(), ANY_INSTANCE))) |
| 854 | || (1 == client_side_logging_filter_.count(std::make_tuple(_message->get_service(), _message->get_instance()))))) { |
| 855 | VSOMEIP_INFO_P << "(" << hex4(client_) << "): [" << hex4(_message->get_service()) << "." << hex4(_message->get_instance()) << "." |
| 856 | << hex4(_message->get_method()) << ":" << hex4(is_request ? session_ : _message->get_session()) << ":" |
| 857 | << hex4(is_request ? client_.load() : _message->get_client()) << "] " |
| 858 | << "type=" << static_cast<std::uint32_t>(_message->get_message_type()) << " thread=" << std::this_thread::get_id(); |
| 859 | } |
| 860 | if (routing_) { |
| 861 | // in case of requests set the request-id (client-id|session-id) |
| 862 | if (is_request) { |
| 863 | _message->set_client(client_); |
| 864 | _message->set_session(get_session(true)); |
| 865 | } |
| 866 | // Always increment the session-id |
| 867 | (void)routing_->send(client_, _message, false); |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | void application_impl::notify(service_t _service, instance_t _instance, event_t _event, std::shared_ptr<payload> _payload, |
| 872 | bool _force) const { |
nothing calls this directly
no test coverage detected