Enable socket broadcast support

This commit is contained in:
momo5502 2023-02-26 13:26:41 +01:00
parent e121260701
commit 7248ce7990

View File

@ -78,6 +78,9 @@ namespace network
throw std::runtime_error("Unable to create socket");
}
constexpr char broadcast = 1;
setsockopt(s, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast));
socket_set_blocking(s, false);
const auto address = htonl(INADDR_ANY);