NTP client

Discussion in 'Java' started by bob, Jun 1, 2012.

  1. bob

    bob Guest

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

    Thanks.
    bob, Jun 1, 2012
    #1
    1. Advertising

  2. 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.
    Gunter Herrmann, Jun 1, 2012
    #2
    1. Advertising

  3. bob

    Roedy Green Guest

    On Fri, 1 Jun 2012 06:50:07 -0700 (PDT), bob <>
    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, Jun 1, 2012
    #3
  4. bob

    Roedy Green Guest

    On Fri, 01 Jun 2012 12:38:47 -0400, Gunter Herrmann
    <> 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
    ..
    Roedy Green, Jun 13, 2012
    #4
  5. 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\Parameters /v "Period" /t REG_DWORD /d 0 /f
    reg add HKLM\System\CurrentControlSet\Services\W32Time\Config /v "MaxNegPhaseCorrection" /t REG_DWORD /d 4294967295 /f
    reg add HKLM\System\CurrentControlSet\Services\W32Time\Config /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
    Gunter Herrmann, Jun 14, 2012
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manzoorul Hassan

    Convert to NTP Timestamp

    Manzoorul Hassan, Mar 11, 2005, in forum: Perl
    Replies:
    1
    Views:
    2,713
    Jim Gibson
    Mar 11, 2005
  2. Janto Dreijer

    ntp in python

    Janto Dreijer, Aug 29, 2006, in forum: Python
    Replies:
    5
    Views:
    3,855
    Jeremy Sanders
    Aug 30, 2006
  3. Replies:
    6
    Views:
    3,934
    Keith Thompson
    Aug 9, 2006
  4. Sadia Bashir
    Replies:
    0
    Views:
    102
    Sadia Bashir
    Jan 30, 2014
  5. Johannes Findeisen
    Replies:
    0
    Views:
    110
    Johannes Findeisen
    Jan 30, 2014
Loading...

Share This Page