Thales' cellular IoT products business is now part of Telit Cinterion, find out more.

You are here

EHS6 - How to resolv server socket name using Java? | Telit Cinterion IoT Developer Community

October 13, 2016 - 11:24pm, 3182 views

Hello,

I tried to connect to a server socket via Java using SocketConnection class but the module was not able to resolve the server name, see code  and exception below. Is there a way that the module could resolve server name in EHS6 using Java? 

Thanks

try {

irisSocket = (SocketConnection) Connector.open("socket://www.teste.com.br:48765;bearer_type=gprs;access_point=apn.com.br;username...", Connector.READ_WRITE, true);

in = irisSocket.openInputStream();

out = irisSocket.openOutputStream();

} catch (IOException e) {

e.printStackTrace();

}

javax.microedition.io.ConnectionNotFoundException: Could not resolve hostname

 - com.sun.midp.io.j2me.socket.Protocol.connect(), bci=89

 - com.sun.midp.io.j2me.socket.Protocol.open(), bci=154

 - com.sun.midp.io.j2me.socket.Protocol.openPrim(), bci=4

 - javax.microedition.io.Connector.open(), bci=47

 - cas.fenix.serverconnector.appia.AppiaConnector.connect(AppiaConnector.java:107)

 - cas.fenix.serverconnector.appia.AppiaConnector.handle(AppiaConnector.java:307)

 - cas.fenix.serverconnector.appia.AppiaConnector.run(AppiaConnector.java:261)