Multicast problem

by Thiago B. » Fri, 10 Apr 2009 01:48:53 GMT

Sponsored Links
 Hi, I'm trying to develop an application that need to send UDP
Multicast packets to the local network.
There is a few equipments that respond to this packets and send back
some informations.
I'm not worried with the server right now, because there is a server
on the same network that collect all this multicast data.
I just want to make my mobile able to send the request message to
start the process.

My client class is called MCastClient, see below:

public class MCastClient {
        private int port = 50000;
        private String addr = "";
        private MulticastSocket sock = null;

        public void sendData(String data) {
                try {
                        InetAddress group = InetAddress.getByName(addr);

                        sock = new MulticastSocket(port);


                        DatagramPacket dataPckt = new 
                                        data.length(), group, port);

                } catch (Exception e) {}

It runs perfectly on my computer as a Java Application.

On the Android Emulator i create a simple application with a button
and add a OnClickListener.

public void onCreate(Bundle savedInstanceState) {

    final MCastClient mcClient = new MCastClient();
    Button btn = (Button)findViewById(;

    btn.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {

I believe that my packet is not arriving on the local network.
I already did some test with the command "redir add udp:50000:50000"
on telnet port of the emulator, that i got from #connecting.

There is any other command that can forward ports to the emulator?
I'm almost putting a port sniffer on my machine just to check what is

Thanks for the help, it will be very appreciated.
Thiago B.


Multicast problem

by David Turner » Fri, 10 Apr 2009 19:14:35 GMT

 Sorry, but the emulator currently doesn't support multicast :-(


Sponsored Links

Other Threads

1. Melambat

Hero saya ternyata melambat setelgh pemakaian 3/4 hari tanpa restart.
Apa solusinya?
Pakai taskkiller kah? (saya baca aplikasi tsb tidak disarankan)


2. Bagus mana yah

Cakep yang kanan :-)

Mohammad Jaedi
Thu, Jan 14, 2010 - 18:19:25 
-----Original Message-----
From: Lucky Sebastian <>
Date: Thu, 14 Jan 2010 18:13:11 
To: Android<>
Subject: [id-android] Bagus mana yah

Tinggal nunggu satu kandidat lg dateng, langsung jejerin.....
Bagus mana ya, tuh kliatan perbandingan ukuran dan tebal.
Ukuran layar milestone menang panjang.

N900, Milestone,.....nunggu batagor

Lucky Sebastian
@google android

3. Voice Call

4. Tampilan Phone Hero

5. (Tanya) dukungan aplikasi utk android

6. How to process this kind of HTTP POST request/reponse

7. tanya pendapat senior