summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Schütz <dominik.schuetz@ropa-maschinenbau.de>2022-02-10 12:38:14 +0100
committerDominik Schütz <dominik.schuetz@ropa-maschinenbau.de>2022-02-10 12:38:14 +0100
commit2a3c993f19294db19527d92b30080e4fc305f1ad (patch)
tree15ddec6dbbd1f87fc73e2d9a4d4c210a9908671b
parent13f9c89ced6ffaeb1faf485152e27e1f40d234cd (diff)
downloadvSomeIP-2a3c993f19294db19527d92b30080e4fc305f1ad.tar.gz
add support for broadcast
-rw-r--r--implementation/endpoints/src/udp_server_endpoint_impl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/implementation/endpoints/src/udp_server_endpoint_impl.cpp b/implementation/endpoints/src/udp_server_endpoint_impl.cpp
index bd6fc62..4cd6a71 100644
--- a/implementation/endpoints/src/udp_server_endpoint_impl.cpp
+++ b/implementation/endpoints/src/udp_server_endpoint_impl.cpp
@@ -338,6 +338,9 @@ void udp_server_endpoint_impl::join_unlocked(const std::string &_address) {
boost::asio::socket_base::reuse_address optionReuseAddress(true);
multicast_socket_->set_option(optionReuseAddress, ec);
boost::asio::detail::throw_error(ec, "reuse address in multicast");
+ boost::asio::socket_base::broadcast optionBroadcast(true);
+ multicast_socket_->set_option(optionBroadcast, ec);
+ boost::asio::detail::throw_error(ec, "set broadcast option");
multicast_socket_->bind(*multicast_local_, ec);
boost::asio::detail::throw_error(ec, "bind multicast");