summaryrefslogtreecommitdiff
path: root/implementation/endpoints/include/udp_server_endpoint_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'implementation/endpoints/include/udp_server_endpoint_impl.hpp')
-rw-r--r--implementation/endpoints/include/udp_server_endpoint_impl.hpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/implementation/endpoints/include/udp_server_endpoint_impl.hpp b/implementation/endpoints/include/udp_server_endpoint_impl.hpp
index c03a7b4..907e022 100644
--- a/implementation/endpoints/include/udp_server_endpoint_impl.hpp
+++ b/implementation/endpoints/include/udp_server_endpoint_impl.hpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2014-2016 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -7,15 +7,17 @@
#define VSOMEIP_INTERNAL_UDP_SERVICE_IMPL_HPP
#include <boost/asio/io_service.hpp>
-#include <boost/asio/ip/udp.hpp>
+#include <boost/asio/ip/udp_ext.hpp>
#include <vsomeip/defines.hpp>
+
#include "server_endpoint_impl.hpp"
namespace vsomeip {
-typedef server_endpoint_impl<boost::asio::ip::udp,
- VSOMEIP_MAX_UDP_MESSAGE_SIZE> udp_server_endpoint_base_impl;
+typedef server_endpoint_impl<
+ boost::asio::ip::udp_ext
+ > udp_server_endpoint_base_impl;
class udp_server_endpoint_impl: public udp_server_endpoint_base_impl {
@@ -37,14 +39,15 @@ public:
endpoint_type get_remote() const;
bool get_remote_address(boost::asio::ip::address &_address) const;
- bool get_multicast(service_t _service, event_t _event,
- endpoint_type &_target) const;
+ unsigned short get_remote_port() const;
void join(const std::string &_address);
void leave(const std::string &_address);
- void add_multicast(service_t _service, instance_t _instance,
- const std::string &_address, uint16_t _port);
- void remove_multicast(service_t _service, instance_t _instance);
+
+ void add_default_target(service_t _service,
+ const std::string &_address, uint16_t _port);
+ void remove_default_target(service_t _service);
+ bool get_default_target(service_t _service, endpoint_type &_target) const;
unsigned short get_local_port() const;
bool is_local() const;
@@ -53,18 +56,21 @@ public:
public:
void receive_cbk(boost::system::error_code const &_error,
- std::size_t _size);
+ std::size_t _size,
+ boost::asio::ip::address const &_destination);
private:
void set_broadcast();
+ bool is_joined(const std::string &_address) const;
private:
socket_type socket_;
endpoint_type remote_;
- std::map<service_t, std::map<instance_t, endpoint_type> > multicasts_;
+
+ std::map<service_t, endpoint_type> default_targets_;
+ std::set<std::string> joined_;
receive_buffer_t recv_buffer_;
- size_t recv_buffer_size_;
std::mutex stop_mutex_;
};