January 04, 2011
I am trying to listen to a multicast group using the std.socket library. I
have looked at the documentation but I do not see a way to join a multicast
group. The code I have so far is pasted below. I am looking for
the IP_ADD_MEMBERSHIP socket option (along the lines of
and can't find within the library.

Let's assume I am trying to listen to

Can someone help me with a snippet on some d code that will do this?

I appreciate the help!


auto socket = new UdpSocket();
auto address = new InternetAddress(12345);
auto multicastAddress = new InternetAddress("");

/// The below naturally does not work and I can't seem to find

// How do I join the multicast address above?

byte[256] buffer;
int read = socket.receiveFrom(buffer);
printf("Received bytes %i", read);
return 0;

Top | Discussion index | About this forum | D home