-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
area-System.NetuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Description
When I was using UdpClient, I found that even when UdpClient.EnableBroadcast was set to false, it could still successfully send data via broadcast.
Reproduction Steps
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
using (var udpClient = new UdpClient(8080))
{
udpClient.EnableBroadcast = false;
var ipEndPoint = new IPEndPoint(IPAddress.Broadcast, 8081);
byte[] data = Encoding.UTF8.GetBytes("test");
udpClient.Send(data, data.Length, ipEndPoint);
}
}
}
}
Expected behavior
When UdpClient.EnableBroadcast is set to false, shouldn't an exception occur?
Actual behavior
When UdpClient.EnableBroadcast is set to false, data can be sent normally via broadcast.
Regression?
No response
Known Workarounds
No response
Configuration
.NET version:.NET 8
System: Windows 10 22H2
Other information
No response
Metadata
Metadata
Assignees
Labels
area-System.NetuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner