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

Mark nospam at nospam.com
Sun Jul 27 14:25:24 UTC 2008


Hello,

I'm new to this list. Thanks for reading this. I hope, with your help, 
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 
the time. I could use a command line tool, but I don't want to use any 
existing tools for this. I want to read the time from a server, directly 
from inside Revolution.

I've had a quick look at 
<http://www.networksorcery.com/enp/rfc/rfc4330.txt> but I don't know 
where to start. I believe, I should first try to get some kind of a 
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".

In pseudocode, I am doing someting like this:

open a udp connection to <time.server.com>
check for error
send some data to <time.server.com>
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
check for errors
wait for a connection from the server at port 123
# the remainder never executes
# because the server doesn't reply
read some data from port 123
check for error and check data
close port 123

There are no errors and no data are received from the server. How do I 
get the server to respond, so I know that I'm ready to implement the 
remainder of the protocol?

Can you recommend any public time servers, or refer me to a list of 
servers, with reliably connections that are good to experiment with?

Any help to get me started is highly appreciated (yes, really).

-- 
Mark

Economy-x-Talk
Have your own custom software created
http://economy-x-talk.com




More information about the questions mailing list