如何获得在Android上多播数据包 [英] How to receive Multicast packets on Android

查看:124
本文介绍了如何获得在Android上多播数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从一个组播地址接收数据,但调用MulticastSocket.receive()阻塞,直到超时发生。 我做了一些网络嗅探,并发现我的设备(和仿真器)从不发送MulticastSocket.joinGroup请求。 我想从我的电脑作为一个独立的应用程序运行在同一个Java code,效果不错。会不会是Android平台块IGMP加入请求? 与多播前有没有人成功地在Android?

I'm trying to receive data from a multicast address, but the call to MulticastSocket.receive() blocks until a timeout takes place. I did some network sniffing and found out that my device (and the emulator) never send a MulticastSocket.joinGroup request. I tried running the same Java code from my PC as a standalone application and it worked well. Could it be that the Android platform blocks IGMP join requests? Has anyone succeeded with Multicast on Android before?

我的清单文件包含以下权限:

My manifest file contains the following permission:

我正在我的2.1的应用程序(这两个仿真器和放大器;设备)。

I am running my application on 2.1 (Both emulator & device).

任何想法吗?

谢谢

推荐答案

,因为它似乎,还有在模拟器没有适当的多播支持。

As it seems, there is no proper multicast support in the emulator.

下面是一个错误报告和相关< A HREF =HTTP://$c$c.google.com/p/android/issues/detail ID = 2323?相对=nofollow>发。它被固定为Froyo的。

Here's a bug report and related thread. It is being fixed for froyo.

这篇关于如何获得在Android上多播数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆