Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   NTP client (http://www.velocityreviews.com/forums/t946608-ntp-client.html)

bob 06-01-2012 01:50 PM

NTP client
 
Does anyone know of a really good implementation of an NTP client in Java?

Thanks.

Gunter Herrmann 06-01-2012 04:38 PM

Re: NTP client
 
Hi!

bob wrote:
> Does anyone know of a really good implementation of an NTP client in Java?


Why not run a client on the OS?
Works perfectly for me on Windows XP and Linux.

Gunter in Orlando, Fl.

Roedy Green 06-01-2012 09:26 PM

Re: NTP client
 
On Fri, 1 Jun 2012 06:50:07 -0700 (PDT), bob <bob@coolfone.comze.com>
wrote, quoted or indirectly quoted someone who said :

>Does anyone know of a really good implementation of an NTP client in Java?


If you want something simple, cannibalise the code inside SetClock. It
works at the UDP level. see
http://mindprod.com/products1.html#SETCLOCK.html

For background on NTP see http://mindprod.com/jgloss/ntp.html
including lists of servers.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Controlling complexity is the essence of computer programming.
~ Brian W. Kernighan 1942-01-01
..

Roedy Green 06-13-2012 07:34 PM

Re: NTP client
 
On Fri, 01 Jun 2012 12:38:47 -0400, Gunter Herrmann
<notformail0106@earthlink.net> wrote, quoted or indirectly quoted
someone who said :

>Why not run a client on the OS?
>Works perfectly for me on Windows XP and Linux.


in windows you spawn
w32tm.exe /resync

to resync your clock. From there you can get time via java.

see http://mindprod.com/jgloss/timesources.html
for details.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Controlling complexity is the essence of computer programming.
~ Brian W. Kernighan 1942-01-01
..

Gunter Herrmann 06-14-2012 02:39 PM

Re: NTP client
 
Hi!

Roedy Green wrote:
> in windows you spawn
> w32tm.exe /resync


In a corporate network you should have (at least) 2 servers that run
ntpd getting the time signals from multiple outside sources.
You should ask for permission to use these sources.
Then close the ntp port in the firewall for everyone except these
servers. All your other systems should get the time from your own
time servers.

On Unix/Linux boxes install ntpd and have it point to your
corporate time servers.

Sync your Windows domain controllers with your corporate ntp
servers, all computers in the domain will get their time from there.

Your windows systems that are not part of a domain should get their
time from your ntp servers.

To automate this I use a batch file to set/change the registry entries.

Here the content:

w32tm /register
w32tm /config /manualpeerlist:"Your corporate servers"
reg add HKLM\System\CurrentControlSet\Services\W32Time\Par ameters /v "Period" /t REG_DWORD /d 0 /f
reg add HKLM\System\CurrentControlSet\Services\W32Time\Con fig /v "MaxNegPhaseCorrection" /t REG_DWORD /d 4294967295 /f
reg add HKLM\System\CurrentControlSet\Services\W32Time\Con fig /v "MaxPosPhaseCorrection" /t REG_DWORD /d 4294967295 /f

Setting the maximum correction to infinity makes sure that a
system with a bad CMOS battery is still synced.

Regards

Gunter


All times are GMT. The time now is 03:36 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57