diff options
author | Michael Busby <prodigysim@gmail.com> | 2021-11-29 04:14:46 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-29 11:14:46 +0100 |
commit | 6c09e023049631ea8b168aec53db4f652a1ec0aa (patch) | |
tree | 6606e38a6c8dfa017afa1b9f2282dc4645df7cf4 /ext/net/ops.rs | |
parent | 3881e2e7bf3bbe4a5d62872a9fb7b6e2e3d82f81 (diff) |
feat(ext/net): enable sending to broadcast address (#12860)
You can now send UDP datagrams to the broadcast address.
Diffstat (limited to 'ext/net/ops.rs')
-rw-r--r-- | ext/net/ops.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/net/ops.rs b/ext/net/ops.rs index 1f7005247..739807123 100644 --- a/ext/net/ops.rs +++ b/ext/net/ops.rs @@ -440,6 +440,8 @@ fn listen_udp( ) -> Result<(u32, SocketAddr), AnyError> { let std_socket = std::net::UdpSocket::bind(&addr)?; std_socket.set_nonblocking(true)?; + // Enable messages to be sent to the broadcast address (255.255.255.255) by default + std_socket.set_broadcast(true)?; let socket = UdpSocket::from_std(std_socket)?; let local_addr = socket.local_addr()?; let socket_resource = UdpSocketResource { |