Skip to content

Commit

Permalink
udp: listen: Rename broadcast config entry to send_broadcasts
Browse files Browse the repository at this point in the history
Signed-off-by: Konrad Gräfe <kgraefe@paktolos.net>
  • Loading branch information
kgraefe committed Mar 22, 2023
1 parent ec5c4a0 commit 480a7fb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/adapters/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct UdpListenConfig {
/// Enables the socket capabilities to send broadcast messages when the listening socket is
/// also used for sending with
/// [`Endpoint::from_listener`](crate::network::Endpoint::from_listener).
pub broadcast: bool,
pub send_broadcasts: bool,

/// Set value for the `SO_REUSEADDR` option on this socket. This indicates that futher calls to
/// `bind` may allow reuse of local addresses.
Expand Down Expand Up @@ -198,9 +198,7 @@ impl Local for LocalResource {
if config.reuse_port || multicast.is_some() {
socket.set_reuse_port(true)?;
}
if config.broadcast {
socket.set_broadcast(true)?;
}
socket.set_broadcast(config.send_broadcasts)?;

if let Some(multicast) = multicast {
socket.join_multicast_v4(multicast.ip(), &Ipv4Addr::UNSPECIFIED)?;
Expand Down

0 comments on commit 480a7fb

Please sign in to comment.