无线管理器:Android
我不明白,
在 android 中创建与 WifiManager 一起使用的 MulticastLock 的目的是什么。
任何人都可以澄清我到底是什么意思以及何时使用...
非常感谢任何帮助..
谢谢 拉凯什
I am not able to get,
What is the purpose of Creating the MulticastLock used with WifiManager in android.
Can any body clarify me what exactly it means and when to use...
Any help much appreciated..
thanks
rakesh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IP 多播是一种只需一次传输即可将数据包发送到一组感兴趣的接收者的方法。正常的单播需要为每个接收者发送一次数据包。 (广播与多播类似,但将数据包传递给同一子网上的每个人。通过多播,接收者组是“可配置的”。)
Android 手机上的 wifi 接口会自动丢弃多播数据包以节省电量。因此,如果您希望能够接收多播数据包,则需要获取多播锁,它的作用是告诉 wifi 驱动程序不要丢弃多播数据包。
仅当您实际加入多播组时才使用它,例如,使用 MulticastSocket 而不是 Java/Android 中的 DatagramSocket 或 Socket。
IP multicast is a method for sending a packet to a group of interested receivers with only one transmission. Normal unicast requires sending the packet once per recipient. (Broadcasting is similar to multicasting, but delivers the packet to everyone on the same subnet. With multicast, the group of receivers is 'configurable'.)
The wifi interface on Android phones will drop multicast packets automatically to save power. Thus, if you want to be able to receive multicast packets, you need to grab the multicast lock which has the effect of telling the wifi driver to not drop multicast packets.
Only use it if you are actually joining a multicast group, e.g., using MulticastSocket instead of DatagramSocket or Socket in Java/Android.
好吧,您可能想阅读有关它的 Android 文档。
但是,如果您不了解多播,该文档并没有说太多,并且可能没有帮助。请参阅:http://en.wikipedia.org/wiki/IP_multicast
多播协议是应用程序 -具体的。您只是好奇,还是有一个应用程序?
Well, you might want to read the Android documentation on it.
But that doc doesn't say a lot, and might not be helpful, if you don't dig Multicast. See: http://en.wikipedia.org/wiki/IP_multicast
Multicast protocols are application-specific. Are you just curious, or do you have an application in mind ?