Friday, September 23, 2011

[android-developers] Re: Multicast Receive

It seems that receiving multi-cast may be a problem forsome devices:

http://stackoverflow.com/questions/3623143/multicast-on-android-2-2

And being that you have it working on other platforms...It would be
great if you could get shark for root on your phone to actually see if
the packets are making it to you.

On Sep 21, 5:00 am, Jasleen Kaur <kjasl...@rediffmail.com> wrote:
> We have been trying to write a rtsp streaming client for Android
> platform in Eclispe.
> we are able to do the handshaking, i.e Describe, Setup, Play requests
> have been sucessfully communicated.
> Now i have chosen to receive the Multicast UDP data packets after PLAY
> command.
>
> The problem is that I am unable to receive the UDP multicast data...in
> the emulator as well as Android device, but am able to receive the UDP
> packets in a java based app and a .Net based app.
>
>                                                        wifi =
> (WifiManager) getSystemService(getApplicationContext().WIFI_SERVICE);
>                                                        mLock =
> wifi.createMulticastLock("mylock");
>
> mLock.setReferenceCounted(true);
>
> mLock.acquire();
>
>                                                       MulticastSocket
> sock;
>
>                                                       InetAddress sessAddr =
> InetAddress.getByName("234.2.128.12");
>                                                       sock = new MulticastSocket(1100);          //
> 48180);
>
>                                                       byte b = 64;
>                                                       sock.setTTL(b);
>                                                       sock.joinGroup(sessAddr);
>
>                                                       byte[] byData = new byte[500];
>                                                       DatagramPacket pack = new DatagramPacket(byData, 500);
>
>                                                       sock.receive(pack);
>
> Plus i have added the following tags to the manifest
>
>         <uses-permission android:name="android.permission.INTERNET" /
>
>         <uses-permission
> android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
>         <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /
>
>
>
> The program gets stuck on the receive statement.
> Pls suggest.
>
> Best Regards
> Jasleen

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment