02-04-2009 02:08 PM
On the 4.5 emulator...
The following code returns null for the local address:
ServerSocketConnection serverSoc = (ServerSocketConnection) Connector.open("socket://:6543;interface=wifi");
String localAddress = serverSoc.getLocalAddress();
System.out.println("Localaddr: " + localAddress); // <---- always null!
but if I switch to UDP it works:
UDPDatagramConnection serverSoc = (UDPDatagramConnection) Connector.open("socket://:6543;interface=wifi");
String localAddress = serverSoc.getLocalAddress();
System.out.println("Localaddr: " + localAddress); // <---- gives valid ip
Is this a bug or am I doing something wrong?
02-06-2009 01:26 PM