[ntp:questions] Writing an SNTP script for Runtime Revolution

David Woolley david at ex.djwhome.demon.co.uk.invalid
Sun Jul 27 15:36:13 UTC 2008


Mark wrote:> Hello,
> 
> I'm new to this list. Thanks for reading this. I hope, with your help, 

Actually its a newsgroup.

> I'll be able to make SNTP available to all Runtime Revolution developers 
> (http://www.runrev.com).
> 
> Obviously, I would like to open a connection to an SNTP server and get

UDP is connectionless, so you cannot open a connection.

> reply from a server, just to see that I can connect. Once I can do that, 
> I believe want to implement section 5 of the protocol, "SNTP Client 
> Operations".

Unless you act as a valid client, you may well not get any reply.

> 
> In pseudocode, I am doing someting like this:
> 
> open a udp connection to <time.server.com>

Physically impossible.

> check for error
> send some data to <time.server.com>

Data needs to be a valid SNTP request.

> check for error
> read some data from <time.server.com>
> check for error and check data
> close connection to <time.server.com>
> 
> I also tried:
> 
> open a udp connection to <time.server.com>
> check for error
> send some data to <time.server.com>
> check for error
> close connection to <time.server.com>
> open port 123 for incoming connections

The response will be to the source port you used in the request.
Note previous comment about there being no connections.
> 
> 
> Can you recommend any public time servers, or refer me to a list of 
> servers, with reliably connections that are good to experiment with?

Install ntpd on a local machine.

> 




More information about the questions mailing list