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

Posts: 33
Registered: ‎11-20-2008
My Device: Not Specified

listening for udp broadcast messages.

I'm trying to listen for a udp broadcast message, but am not having much luck. When I create a server socket with some code like the following:



_conn = (DatagramConnection) Connector.open("udp://:2190;interface=wifi;deviceside=true");


A listener is created but its just bound to my wifi ip. Traffic udp traffic sent directly to my ip & port arrives without issue. What I would like to do is bind to an address which would allow me to receive broadcast traffic eg or (I'm on a private wifi network here). However when I try to do the following:


_conn = (DatagramConnection) Connector.open("udp://;interface=wifi;deviceside=true"); // or _conn = (DatagramConnection) Connector.open("udp://;interface=wifi;deviceside=true");


I get a java.lang.IllegalArgumentException when I call receive on the datagram connection.

Is there any way around this? Is there a lower-level api that can be leveraged here, or is it simply unsupported?



BlackBerry Development Advisor
Posts: 15,808
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: listening for udp broadcast messages.

This is not currently supported.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000

Re: listening for udp broadcast messages.

The ability to receive broadcast packets has obviously been disabled on purpose.  Will this decision be reversed any time in the foreable future? 
Earl Oliver
New Developer
Posts: 20
Registered: ‎09-24-2009
My Device: Not Specified

Re: listening for udp broadcast messages.

I have the same question (eaoliver  question)
Posts: 38
Registered: ‎07-06-2010
My Device: BlackBerry Torch 9800
My Carrier: BSNL

Re: listening for udp broadcast messages.

Hi all,


Is there any way to do UDP listening?

I could broadcast a UDP packet. But my server failed to identify source port.My application didnt receive any UDP Packets.

I need to implement UDP to get Sever IP address. Is there any other way out to get an IP addrees of a remote server from BB?


Thank You,