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

New Developer
Posts: 11
Registered: ‎08-19-2008
My Device: Not Specified

UDP broadcast into subnet

UDPDatagramConnection udp = (UDPDatagramConnection)Connector.open("udp://;12346"); String msg="subnet broadcast message"; byte [] bytes=msg.getBytes(); udp.send(udp.newDatagram(bytes,bytes.length)); Datagram dg = prueba.newDatagram(udp.getMaximumLength()); udp.receive(dg); byte[] data = new byte[dg.getLength()]; dg.readFully(data);

I have tested this code on the simulator 8100 and it works, my server application is receiving message on 12345 port and simulator also receives response message on 123456 port.

On the real device BB 8120 same code doesn't works.

I want to send data to comupter from wi-fi network and receive response. 

I have tried  add suffix ";interface =wifi" but it throws "invalid number" exception.

any ideas?



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

Re: UDP broadcast into subnet

UDP connections are routed over a carrier's network.  The interface=wifi parameter can be used with socket, HTTP, HTTPS, TLS and SSL connections.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker