01-28-2009 11:52 PM
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;devices
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 0.0.0.0 or 192.168.1.255 (I'm on a private wifi network here). However when I try to do the following:
_conn = (DatagramConnection) Connector.open("udp://192.168.1.255:2190;interface
=wifi;deviceside=true"); // or _conn = (DatagramConnection) Connector.open("udp://0.0.0.0:2190;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?
01-29-2009 03:57 PM
03-17-2011 04:27 AM
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?