NetworkInterface.EnableStaticIP(ip, subnet, gateway, mac); NetworkInterface.EnableStaticDns(new byte[] { 192, 168, 1, 1 }); Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, multicastIPAddress.GetAddressBytes()); socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 1); IPAddress DestinationIP = new IPAddress(new byte[] { 239, 255, 0, 1 }); IPEndPoint DestinationEndPoint = new IPEndPoint(DestinationIP, 5568);
Support for UDP Multicast?
#1
Posted 17 April 2012 - 03:50 AM
#2
Posted 17 April 2012 - 04:58 AM
#3
Posted 11 December 2012 - 04:05 AM
Hi Mercer,
Since we have more flash and RAM on Netduino Go, we may be able to support this...as long as NETMF supports it.
Chris
Hello Chris,
I finally got around to testing this with the N2+. When I call SetOption, I get the following error
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, multicastIPAddress.GetAddressBytes()); //Fails socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 1); // Fails socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true); // Works
Any idea why this is failing or if this could be addressed in a future release? I believe NETMF supports this, but not sure. Thanks.
#4
Posted 11 December 2012 - 06:26 PM
Is support for multicast planned?
mIP could be modified to do generic UDP multicast. Right now mIP does multicast for the mDNS implementation. All the code is C# too. The only hiccup is getting a firmware build without the Ethernet compiled in. Chris, what would happen if someone loaded the NetduinoGo firmware on the N2+ ?
See mip.codeplex.com
-Valkyrie-MT
#5
Posted 17 December 2012 - 11:19 PM
mIP could be modified to do generic UDP multicast. Right now mIP does multicast for the mDNS implementation. All the code is C# too. The only hiccup is getting a firmware build without the Ethernet compiled in. Chris, what would happen if someone loaded the NetduinoGo firmware on the N2+ ?
See mip.codeplex.com
-Valkyrie-MT
Thanks Valkyrie for the suggestion.
#6
Posted 17 December 2012 - 11:21 PM
#7
Posted 18 December 2012 - 12:00 AM
#8
Posted 18 December 2012 - 04:08 PM
#9
Posted 21 December 2012 - 02:55 AM
#10
Posted 22 December 2012 - 06:00 AM
Hi Mercer,
Is this code which works on some other NETMF board? If NETMF supports it and turning on the feature won't overflow the RAM, we could certainly support it.
If it's not something which NETMF supports, we can request that it be added (or add it as a community and contribute it to the netmf.codeplex.com core).
Chris
Chris.
I did some testing on another board, and the following code works as expected.
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, multicastIPAddress.GetAddressBytes()); socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, 1); IPAddress DestinationIP = new IPAddress(new byte[] { 239, 255, 0, 1 }); IPEndPoint DestinationEndPoint = new IPEndPoint(DestinationIP, 5568);
So, it looks like this could be supported in future releases and would make a great addition. Thank you for considering.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users