December 17, 2013
Hello all,

I've been looking into how to create a multicast packet using std.socket, and I found that std.socket doesn't support the socket option IP_ADD_MEMBERSHIP. Should I be using IPv6 for all of my multicast needs?

-Evan Davis
December 18, 2013
On Tuesday, 17 December 2013 at 21:21:09 UTC, Evan Davis wrote:
> Hello all,
>
> I've been looking into how to create a multicast packet using std.socket, and I found that std.socket doesn't support the socket option IP_ADD_MEMBERSHIP. Should I be using IPv6 for all of my multicast needs?
>
> -Evan Davis

You should be able to use Socket.setOption to set any socket option that is not specifically listed in std.socket.

The option enum value IP_ADD_MEMBERSHIP is available in the following lower-level modules:

std.c.linux.socket
std.c.osx.socket
std.c.windows.winsock

To access the correct enum value, import the required module for whichever OS you are using. You'll also have to do a cast of the value as follows: cast(SocketOption)IP_ADD_MEMBERSHIP

This solution is of course far from ideal, but it is a workable temporary solution until std.socket is improved.

I suggest that you file a bug report on this issue
https://d.puremagic.com/issues/enter_bug.cgi

--rt