NTP-client
NTP-client copied to clipboard
NTP client in C++ (compatible with chrony)
NTP client
This is a C++ class that implements a NTP client. It has been tested with a chrony server. I have also included a sample of my chrony.conf file where I have setup a local server and client for my experiments.
build
First create an empty directory inside your working folder:
mkdir build && cd build
and then
cmake ..
and
cmake --build .
Optional, if you want to install:
make install DESTDIR={YOUR_INSTALLATION_PATH}
By default, the installation path is /usr/local/
licence
Part of the code has been based to C NTPClient by David Lettier
useful links for understanding the client internals
- UDP Server-Client implementation in C
- Let's make a NTP Client in C
- Technical information - NTP Data Packet
useful links for setting up a chrony server in ubuntu
- Ubuntu Bionic: Using chrony to configure NTP (which works for Xenial as well)
- rosbee - chrony.wiki
License
MIT