td icon indicating copy to clipboard operation
td copied to clipboard

clock: support network clock

Open iyear opened this issue 3 years ago • 1 comments

Description

I want to add a basic network clock implementation that uses ntp to calibrate the time and record the offset, the Ticker and Timer implementations are the same as clock.System.

Note: will import new mod: https://github.com/beevik/ntp

Add it in gotd/td or in gotd/contrib?

References

https://core.telegram.org/mtproto#time-synchronization

Having received such a message or a container holding it, the client first performs a time synchronization (in effect, simply storing the difference between the server's time and its own to be able to compute the “correct” time in the future) and then verifies that the message identifiers for correctness.

iyear avatar Sep 20 '22 02:09 iyear

Actually, Time can be calibrated from mtproto server, so no ntp server is required.

I think that ntp-based solution should be in contrib, and mtproto-based can be in main repo.

ernado avatar Sep 20 '22 07:09 ernado