Recipe 60 | Reading Time with NTP over UDP |
Task
Your team found out that the application server clock is drifting from the actual time. Due to the drift, logs have the wrong timestamp, which makes it hard to order them and debug issues.
Emma, your team lead, tasks you with updating the current time in the application from a network time protocol[36](NTP) server.
ntdp | |
---|---|
This problem can (and should) be solved with running a service like ntpd [server.](https://linux.die.net/man/8/ntpd I’m using this recipe as an example for using UDP, not synchronizing time. |
Solution
You read RFC5905[37] and find out that NTP is a binary protocol over UDP. You start ...
Get Effective Go Recipes now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.