diff options
author | Lutz Bichler <Lutz.Bichler@bmw.de> | 2014-07-22 15:52:55 +0200 |
---|---|---|
committer | Lutz Bichler <Lutz.Bichler@bmw.de> | 2014-07-22 15:52:55 +0200 |
commit | dfad8d7c346ec3d717c2c21d9350a9ffc0fb6275 (patch) | |
tree | 1503fbca749f42660a351a6376477a68aebc71bf /implementation/routing | |
parent | 3bd8a40650c18cf901817c0ed9c09e1712b8ddcf (diff) | |
download | vSomeIP-dfad8d7c346ec3d717c2c21d9350a9ffc0fb6275.tar.gz |
Fix receiving in case of multicasts (e.g. SD).
Make serialize/deserialize-methods in entry_impl- and
option_impl-classes virtual as the base classes that contained the
virtual-specification in earlier versions do no longer exist.
Added show-method to serializer to facilitate analysis of serialization
problems.
Diffstat (limited to 'implementation/routing')
-rw-r--r-- | implementation/routing/src/routing_manager_impl.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/implementation/routing/src/routing_manager_impl.cpp b/implementation/routing/src/routing_manager_impl.cpp index 8a9246e..f1dcdf9 100644 --- a/implementation/routing/src/routing_manager_impl.cpp +++ b/implementation/routing/src/routing_manager_impl.cpp @@ -287,7 +287,7 @@ void routing_manager_impl::set(client_t its_client, } void routing_manager_impl::on_message(const byte_t *_data, length_t _size, endpoint *_receiver) { -#if 0 +#if 1 std::stringstream msg; msg << "rmi::on_message: "; for (uint32_t i = 0; i < _size; ++i) @@ -396,23 +396,24 @@ std::shared_ptr< configuration > routing_manager_impl::get_configuration() const void routing_manager_impl::create_service_discovery_endpoint( const std::string &_address, uint16_t _port, const std::string &_protocol) { bool is_reliable = (_protocol != "udp"); - std::shared_ptr< endpoint > its_endpoint = find_server_endpoint(_port, is_reliable); - if (!its_endpoint) { - its_endpoint = create_server_endpoint(_port, is_reliable); + + std::shared_ptr< endpoint > its_service_endpoint = find_server_endpoint(_port, is_reliable); + if (!its_service_endpoint) { + its_service_endpoint = create_server_endpoint(_port, is_reliable); std::shared_ptr< serviceinfo > its_info(std::make_shared< serviceinfo >( VSOMEIP_ANY_MAJOR, VSOMEIP_ANY_MINOR, VSOMEIP_ANY_TTL)); if (is_reliable) { - its_info->set_reliable_endpoint(its_endpoint); + its_info->set_reliable_endpoint(its_service_endpoint); } else { - its_info->set_unreliable_endpoint(its_endpoint); + its_info->set_unreliable_endpoint(its_service_endpoint); } // routing info services_[vsomeip::sd::VSOMEIP_SD_SERVICE][vsomeip::sd::VSOMEIP_SD_INSTANCE] = its_info; - its_endpoint->join(_address); - its_endpoint->start(); + its_service_endpoint->join(_address); + its_service_endpoint->start(); } } @@ -558,6 +559,11 @@ std::shared_ptr< endpoint > routing_manager_impl::create_server_endpoint(uint16_ its_endpoint->enable_magic_cookies(); } } else { + if (its_address.is_v4()) { + its_address = boost::asio::ip::address_v4::any(); + } else { + // TODO: how is "ANY" specified in IPv6? + } its_endpoint = std::make_shared< udp_server_endpoint_impl >( shared_from_this(), boost::asio::ip::udp::endpoint(its_address, _port), |