Allow set custom port for NTP server

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
networking

Research direction

Start in kronos-java/src/main/java/com/lyft/kronos/internal/ntp/SntpClient.java at the DNS resolution point referenced in the issue. Review how the host is passed to dnsResolver.resolve and how NTP_PORT is used, then verify that a host with an optional port uses that port while a host without one retains the fallback behavior.

Written by the indexing model from the issue text.

Description

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);).

Dominant language
Kotlin
Stars
287
Forks
17
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lyft/Kronos-Android

All issues in lyft/Kronos-Android

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.