Gemalto is now part of the Thales Group, find out more.

You are here

Java Datagram problem | Thales IoT Developer Community

tajo.oranic@gmail.cm

June 28, 2016 - 2:20pm, 1678 views

Hello,

Why do i get Invalid host Exeption when trying to enter url address in the following statment:

String server = "0.europe.pool.ntp.org";

Datagram sendDatagram = udp.newDatagram(buf, buf.length, "datagram://"+server+":123"); 

If i enter ip address    in the server varible works just fine?

I even tried to  add dns  in connURL but no luck... 

connURL.append(";dns=213.229.192.161");

Is there a dns problem or newDatagram throws  exeption?

Regards,

T.