22#include <sys/socket.h>
25#include "network_time_protocol.h"
Class that represents the netowrk-time-protocol client that synchronizes with a server.
Definition: ntp_client.h:41
NTPPacket m_serverResponse
Definition: ntp_client.h:48
void NTPClientProcedure()
Thread procedure for handling NTP synchronization.
Definition: ntp_client.cc:20
static constexpr int NTP_PORT
Definition: ntp_client.h:43
std::string m_serverAddress
Definition: ntp_client.h:47
int m_NTPSocket
Definition: ntp_client.h:46
std::atomic< bool > m_isSynchronizing
Definition: ntp_client.h:50
static constexpr int NTP_SYNC_PERIOD_S
Definition: ntp_client.h:44
pthread_t m_NTPClientThreadId
Definition: ntp_client.h:49
void startSynchronization(const std::string &serverAddress)
Starts NTP synchronization of the client.
Definition: ntp_client.cc:91
NTPClient()
Constructs a NTPClient object.
Definition: ntp_client.cc:99
Structure representing an NTP packet.
Definition: network_time_protocol.h:68