Open MarkVillacampa opened 5 years ago
From my observation, even if it does not propagate result to onSuccess
yet, you can call TrueTimeRx.now()
to get intermediate best result.
I'd also like to request the ability to discard failed requests. For the purposes of what I need TrueTimeRx for, I just need the first successful request that comes in.
If the NTP server I'm using resolves to 4 IPs, then TrueTime will make 4 x 5 = 20 requests. If only one of those requests times out (30 seconds by default), even if all 19 other requests are successful, TrueTime will not calculate a time until after that request succeeds.
I am not sure if this is included in the NTP spec or it's a design decision in the TrueTime library, but would it make sense to include an option to accept a threshold of successful requests after which the time can be calculated, discarding the few failed requests? Say, if up to 10% of requests fail, still pick the best one of the ones that succeeded.
Example of one failed request holding back time calculation for 30 seconds: