From 2a3c993f19294db19527d92b30080e4fc305f1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCtz?= Date: Thu, 10 Feb 2022 12:38:14 +0100 Subject: [PATCH] add support for broadcast --- implementation/endpoints/src/udp_server_endpoint_impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/implementation/endpoints/src/udp_server_endpoint_impl.cpp b/implementation/endpoints/src/udp_server_endpoint_impl.cpp index bd6fc6257..4cd6a714a 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");