Kronos-Android icon indicating copy to clipboard operation
Kronos-Android copied to clipboard

Allow set custom port for NTP server

Open babcca opened this issue 5 years ago • 0 comments

Hi, your SntpClient.java has hardcoded NTP port. https://github.com/lyft/Kronos-Android/blob/master/kronos-java/src/main/java/com/lyft/kronos/internal/ntp/SntpClient.java#L91

Sometimes is useful host custom NTP server on different then well known (blocked) port.

What about parse port for NTP server from host using : as separator and NTP_PORT as fallback? Define host like host := "hostname[:port]" where hostname is string containing DNS or IP address of target NTP server and optional port for target listening port number.

Right before dns resolve(InetAddress address = dnsResolver.resolve(host);).

babcca avatar Dec 22 '20 16:12 babcca