11-08-2009 12:49 PM
Is this possible?
I really hate to create some kind of socket connection or datagram connection just for obtaining the IP address of a remote host. Is there a short cut to do this like most OS APIs gethostbyname call?
11-08-2009 08:41 PM
gethostbyname makes a connection. This is how DNS works everywhere.
Why do you need the IP address?
If you're connecting through BES/BIS, and you don't need to rely on DNS, because the BES/BIS servers will do this for you.
11-08-2009 09:19 PM
I need to unicast the same message to multiple receivers.
dc = (UDPDatagramconnection) Connector.open("udp://;1234;interface=wifi");
Datagram dg = dc.newDatagram(buf, buf.length);
dg.setAddress(IPAddrOfServer1);
dc.send(dg);
dg.setAddress(IPAddrOfServer2);
dc.send(dg);
dg.setAddress(IPAddrOfServerN);
dc.send(dg);
11-08-2009 09:44 PM
I don't think there is any support for DNS in the BB API (there might be in 5.0? I didn't look); you will have to implement a DNS resolver yourself, I think.