public class SntpClient
extends java.lang.Object
Constructor and Description |
---|
SntpClient() |
Modifier and Type | Method and Description |
---|---|
long |
getNtpTime()
Returns the time computed from the NTP transaction. * * @return time value computed from NTP server response.
|
long |
getNtpTimeReference()
Returns the reference clock value (value of SystemClock.elapsedRealtime()) * corresponding to the NTP time. * * @return reference clock corresponding to the NTP time.
|
long |
getRoundTripTime()
Returns the round trip time of the NTP transaction * * @return round trip time in milliseconds.
|
boolean |
requestTime(java.lang.String host,
int timeout)
Sends an SNTP request to the given host and processes the response. * * @param host host name of the server. * @param timeout network timeout in milliseconds. * @return true if the transaction was successful.
|
public boolean requestTime(java.lang.String host, int timeout)
public long getNtpTime()
public long getNtpTimeReference()
public long getRoundTripTime()