Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 2
Registered: ‎02-12-2012
My Device: Blackberry 7
My Carrier: Simulator

Receive Multicast?

Hi, I'm using the MulticastDatagramConnection to receive multicast udp packets. However, its simply not receiving. I have verified that the packets are being sent, and a test java application receives them just fine.

 

Does anyone know why the MulticastDatagramConnection would fail to receive multicast packets?

 

Here's how I'm using it:

 

byte[] buffer = new byte[4096];

MulticastDatagramConnection con = (MulticastDatagramConnection)Connector.open("datagram://:20002;interface=wifi");

Datagram datagram = con.newDatagram(buffer, buffer.length);

 

con.joinGroup("224.0.0.6");

con.receive(datagram);   // This line blocks the Thread, and it never receives anything Smiley Sad

Developer
Posts: 484
Registered: ‎07-17-2008
My Device: Not Specified

Re: Receive Multicast?

I haven't played with this so I might just be **bleep** in the wind but try testing with a small receive buffer...say 8 bytes instead of 4K.