API Documentation
Loading...
Searching...
No Matches
NtpClient Class Reference

#include <NtpClient.h>

Inheritance diagram for NtpClient:
[legend]
Collaboration diagram for NtpClient:
[legend]

Signals

void replyReceived (const QHostAddress &address, quint16 port, const NtpReply &reply)
 
- Signals inherited from TimeRequest
void finishedSignal ()
 
void errorOccurredSignal (int error)
 

Public Member Functions

 NtpClient (const String &host, uint02 bind_port, uint02 remote_port)
 
virtual ~NtpClient ()
 
bool bind (const QHostAddress &bindAddress=QHostAddress::Any, quint16 bindPort=0)
 
bool sendRequest (const String &address, quint16 port)
 
bool sendRequest (const QHostAddress &address, quint16 port)
 
const QUdpSocket * socket () const
 
- Public Member Functions inherited from TimeRequest
virtual Time serverTime () const =0
 
virtual Time txTime () const =0
 
virtual Time rxTime () const =0
 
TimeSpan roundTripDelay () const
 
TimeSpan localClockOffset () const
 

Detailed Description

NTP client.

Constructor & Destructor Documentation

◆ NtpClient()

NtpClient ( const String & host,
uint02 bind_port,
uint02 remote_port )
inline

◆ ~NtpClient()

virtual ~NtpClient ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ bind()

bool bind ( const QHostAddress & bindAddress = QHostAddress::Any,
quint16 bindPort = 0 )
inline
Parameters
bindAddressNetwork address to bind upd socket to. It's passed to QUdpSocket::bind.
bindPortNetwork port to bind udp socket to.
Returns
Whether the socket was successfully bound.

◆ replyReceived

void replyReceived ( const QHostAddress & address,
quint16 port,
const NtpReply & reply )
signal

This signal is emitted whenever NTP reply is received.

Parameters
addressAddress of the server that sent this reply.
portPort of the server that sent this reply.
replyNTP reply.

◆ sendRequest() [1/2]

bool sendRequest ( const QHostAddress & address,
quint16 port )
inline

◆ sendRequest() [2/2]

bool sendRequest ( const String & address,
quint16 port )
inline

Sends NTP request.

Parameters
addressNTP server address.
portNTP server port.
Returns
Whether the NTP request was successfully sent.

◆ socket()

const QUdpSocket * socket ( ) const
inline

The documentation for this class was generated from the following file: