Skip to content

Commit

Permalink
Add Response.IsKissOfDeath()
Browse files Browse the repository at this point in the history
  • Loading branch information
beevik committed Jul 13, 2023
1 parent fca6be4 commit 1cf04cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ntp.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,13 @@ type Response struct {
authErr error
}

// IsKissOfDeath returns true if the response is a "kiss of death" from the
// remote server. If this function returns true, you may examine the
// response's KissCode value to determine the reason for the kiss of death.
func (r *Response) IsKissOfDeath() bool {
return r.Stratum == 0
}

// Validate checks if the response is valid for the purposes of time
// synchronization.
func (r *Response) Validate() error {
Expand Down

0 comments on commit 1cf04cc

Please sign in to comment.