You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes have problems with Clock.sync() not returning a TimeInterval in the completion closure. After an analysis I found out that the problem lies in the NTPClient in private func offset(from responses: [[NTPPacket]]) throws -> TimeInterval. All server responses are filtered here by originTime (which is afaik ok). Now it can happen that certain responses take longer than 10 seconds (= kMaximumResultDispersion), especially if I use the default NTP server(s) time.apple.com with the default 4 samples. If this happens with the last response, no TimeInterval is returned. Although validate timeIntervals might have been returned beforehand. Is this done on purpose or would it also be possible to save the offsets in the sync() function (Clock.swift) and then return an average value at the end?
If I use the first closure I always get a valid offset (maybe there are cases where this response is also filtered).
The text was updated successfully, but these errors were encountered:
I sometimes have problems with
Clock.sync()
not returning aTimeInterval
in thecompletion
closure. After an analysis I found out that the problem lies in theNTPClient
inprivate func offset(from responses: [[NTPPacket]]) throws -> TimeInterval
. All server responses are filtered here byoriginTime
(which is afaik ok). Now it can happen that certain responses take longer than 10 seconds (=kMaximumResultDispersion
), especially if I use the default NTP server(s)time.apple.com
with the default 4 samples. If this happens with the last response, noTimeInterval
is returned. Although validate timeIntervals might have been returned beforehand. Is this done on purpose or would it also be possible to save the offsets in thesync()
function (Clock.swift
) and then return an average value at the end?If I use the
first
closure I always get a valid offset (maybe there are cases where this response is also filtered).The text was updated successfully, but these errors were encountered: