Multicast with DatagramSocket


#1

Hi Jules, now that you've been into the DatagramSocket stuff recently, could you guys have a look at supporting multicast ? (more info here http://www.juce.com/forum/topic/dataramsocket-intended-be-used-half-duplex)

 


#2

I had a quick look, but the suggested code that was posted back in 2012 is pretty divergent from the current files, and it's hard to see what the important changes are.. Would be happy to have a look if anyone can give me something more up-to-date to look at!


#3

Hehe... that would've been my next question :) I'll try adapt the code to current codebase, and make a patch for it.


#4

Well, I can now receive multicast packets, but for some reason, some packets are dropped. Those that start with "HTTP/1.1 200 OK..." are never(!) received.

Anyone that could shed light on what could cause this ?


#5

I’ll take a look. It sounds like port sharing isn’t quite right.


#6

Probably my bad, the UDP listener sees only the SSDP packets (239.255.255.250:1900), but the UPnP Device sniffer tool sees ALL messages, even the one that are unicast (i.e. the ones starting with "HTTP/1.1..."). So it might not be a problem at all.

Edit: UPnP tools can be found here. https://software.intel.com/en-us/articles/intel-tools-for-upnp-technologies

 


#7

Another problem is the way the DatagramSocket sets up the "to" address when sending packets. The source address is set to 127.0.0.1 when sending the packets, which is a bit of a problem since the receiving multicast listener uses that source address to send UDP unicast back to the sender. However using this code http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html , a message sent to the multicast group gets the correct source address, i.e. 192.168.78.12..