I am learning and trying to understand how Multicast is implemented in Java. I developed the small program shown in the example http://www.nmsl.cs.ucsb.edu/MulticastSocketsBook/#javaexamples , and it multicasted datagram packets (UDP) to multiple clients on the same host.
However, when I tried to start clients on different computers (within the same local network (for example, my home WiFi), there were no packets on the client computer. I made sure that my router firewall was turned off and all other machines opened the port.
Thinking that my program might have some error, I took examples, compiled them and started the server and client on different machines, but the same result (without delivering packets to different machines). I even tried running the client on Ubuntu (in VirtualBox using the Bridge Adapter), but no luck.
After going through SO, I stumbled upon Java Multicast Time To Live always 0 , explaining the problem with the TTL header in Java multicast. So I applied the proposal provided in the answer to this question, but still the same problem. I tracked packets using WireShark and checked that TTL really has a value of 5 (I set it to 5 to increase the probability!)
I am not sure where I am going wrong. I would really appreciate it if you could point me in the right direction.
PS: I used multicast addresses such as 235.1.1.1/239.255.211.111 and port 4466 (I saved this port in the firewall of all machines for incoming + outgoing n / a)
source
share