Hello.
I want to broadcast UDP-packets on a Netduino3 Ethernet (firmware: 4.3.2.3).
Looking around the internet and the forum i found information about it and it seems to work.
When i try to broadcast UDP the board blocks when sending.
here the code i use:
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse("192.168.0.255"), 10000);
byte[] data = Encoding.UTF8.GetBytes("hello, world!");
// netduino hangs here:
socket.SendTo(data, ipEndPoint);
i also tried with (same result):
socket.SendTo(data, data.Length, SocketFlags.Broadcast, ipEndPoint);
what’s wrong?
how would i broadcast UDP?
thanks!
ingo