• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TimeClient class that uses Time protocol

 
Roger Fed
Ranch Hand
Posts: 82
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've developed this This client class that tries to connect to time protocol on port 37

but it give me this error
java.net.UnknownHostException: time.nist.gov
I'd be grateful if you can help me?
thanks in advance..........................
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried any other servers, like the ones listed in http://tf.nist.gov/tf-cgi/servers.cgi ?

Not sure if that particular server usually responds to ping, but right now it doesn't.
 
Roger Fed
Ranch Hand
Posts: 82
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer for your valuable help, I've tried another server and it works well but I have one question concerning this code:
Can you explain to me what this line do???
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like the server returns the seconds since the epoch (1.1.1970) as a 4-byte value. That's actually all the server returns according to the RFC that specifies the time protocol.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic