从 Java 编程的角度来看,多播对网络程序有什么不同?
我的经理要求我评估需要进行哪些更改才能将多播支持添加到基于套接字的 TCP/IP 网络程序(交易系统的一部分)。
据我所知,从Java程序的角度来看,程序是单播还是多播似乎并没有太大关系。
Java 网络 API 不是让这一切变得透明吗?我的意思是,这种改变难道不是简单地为传出连接添加额外的目的地吗?
My manager has asked me to assess what changes would be required to add multicast support to a socket-based TCP/IP networking program that is part of a trading system.
As far as I can tell, from the perspective of a Java program, it doesn't seem to matter too much whether the program is unicast or multicast.
Doesn't the Java networking API make all of this transparent? By this I mean, wouldn't the change be a simple one of simply adding additional destinations for the outgoing connections?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,TCP不支持多播。多播通常通过 UDP 完成。 UDP 的设计并不是一种可靠的传输。即,不能保证数据报到达目的地,并且当它到达目的地时没有传送报告。
这个问题中讨论了一些可靠的多播解决方案,但它们本质上是不同的协议。
因此,如果您的应用程序需要在使用多播时保证交付,那么您肯定需要对通信层进行一些更改。
As far as I know, TCP doesn't have support for multicast. Multicast is often done via UDP. UDP by design is not a reliable transport. I-e there is no guarantee of datagram reaching its destination and there is no delivery report when it does reach the destination.
Some reliable multicast solutions are discussed in this question but they are in-essence different protocols.
So if you your application needs to guarantee delivery while using multicast, you will certainly need do some changes in your communication layer.