IPV6 Multicast Sockets

J

jlamanna

Hi.
I'm adding IPV6 support to my app, and I have a UDP Broadcast socket
that I need to redo using IPV6.
I know that IPV6 doesn't have a notion of broadcast anymore, its all
multicast (broadcast translates to a multicast address of ff02::1
essentially).
However, the following code throws an exception on the
SetSocketOption() call:

Socket s1 = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram,
ProtocolType.Udp);
s1.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.Broadcast, 1);
s1.Bind(new IPEndPoint(IPAddress.IPv6Any, 60000));
s1.SetSocketOption(SocketOptionLevel.IPv6,
SocketOptionName.AddMembership,
new MulticastOption(IPAddress.Parse("ff02::1")));

Any ideas?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top