I am attempting to send multicast packets using the Panda II and get an exception when trying to configure SetSocketOption. Does the Panda support multicasting? Is there another way to configure the socket? Any suggestions? Thank you.
byte[] data = new byte[512];
byte[] ip = { 192, 168, 1, 200 };
byte[] subnet = { 255, 255, 255, 0 };
byte[] gateway = { 192, 168, 1, 1 };
byte[] mac = { 0x00, 0x26, 0x1C, 0x7B, 0x29, 0xE8 };
// create an ipaddress object based on multicast
IPAddress multicastIPAddress = new IPAddress(new byte[] { 239, 255, 0, 1 });
WIZnet_W5100.Enable(SPI.SPI_module.SPI1, (Cpu.Pin)FEZ_Pin.Digital.Di10, (Cpu.Pin)FEZ_Pin.Digital.Di7, true); // WIZnet interface with FEZ Connect
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);
Exception System.Exception - 0x00000000 (4)
#### Message: Not Supported Methord
#### GHIElectronics.NETMF.Net.SocketNative::setsockopt [IP: 0006] ####
#### GHIElectronics.NETMF.Net.Sockets.Socket::SetSocketOption [IP: 0012] ####
#### Program::MyThread [IP: 00ba] ####
A first chance exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.W5100.dll
An unhandled exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.W5100.dll
Additional information: Not Supported Methord