Java Multicast sample program is unable to deliver packets within LAN (across hosts) [closed]

ε祈祈猫儿з 提交于 2019-11-30 17:33:59

问题


I am learning and trying to understand how Multicast is implemented in Java. I had developed a small program following the example given at http://www.nmsl.cs.ucsb.edu/MulticastSocketsBook/#javaexamples and it did do multicast of datagram (UDP) packets to multiple clients on same host.

However when I tried to run clients on different machines (within same LAN (i.e. my home WiFi) no packets got received at client end. I made sure that my router's firewall was disabled as well as all other machines had a port open.

Thinking my program could have some error, I took the examples, compiled them and run server and client on different machines but same result (no packet delivery to different machines). I even tried running client on Ubuntu (within VirtualBox with Bridge Adapter) but no luck.

After going through SO, I came across Java Multicast Time To Live is always 0 explaining the problem with TTL header in Java multicast. So I applied the suggestion provided in that question's answer but still same problem. I tracked the packets with WireShark and verified that TTL had indeed value 5 (I set it to 5 to widen the probability !)

I am not sure where I am doing wrong. I would really appreciate if you can point me into right direction.

P.S. : I had used multicast addresses like 235.1.1.1 / 239.255.211.111 and port 4466 (this port I kept open in firewall of all machines for inbound + outbound n/w)

来源:https://stackoverflow.com/questions/8471447/java-multicast-sample-program-is-unable-to-deliver-packets-within-lan-across-ho

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!