Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS-ntp returning same value as device #43

Open
usmaanirfan opened this issue Jul 25, 2016 · 4 comments
Open

iOS-ntp returning same value as device #43

usmaanirfan opened this issue Jul 25, 2016 · 4 comments

Comments

@usmaanirfan
Copy link

iOS-ntp returning same value as device, when i change device time network time change as well please help what m i missing? as i check didReceiveData not get called in NetAssociation.

@gavineadie
Copy link
Collaborator

What time host are you using? If it doesn't exist or doesn't respond, you'll get this behavior. Remember that NTP is a UPD (datagram) protocol; unlike TCP it is not obliged to report network errors so your application will need to deal with them.

@ankit776
Copy link

ankit776 commented Mar 1, 2017

not able to get network time it always shows device time.

@gavineadie
Copy link
Collaborator

What time host are you using? The default is NO host and this behavior.

@momin96
Copy link

momin96 commented Jul 11, 2017

I was having same problem, I solved it by placing below method call in application:didFinishLaunchWithoptions:
NetworkClock * networkClock = [NetworkClock sharedNetworkClock];

But it introduced a new problem, First time I was able to fetch correct network time, but as soon as application went in background and came to foreground same issue arises.
I tried to place above call in applicationWillEnterForeground: as well in applicationDidBecomeActive:, but did not found solution for above problem

I am using this host in ntp.hosts file in.pool.ntp.org
Edit: I tested with time.apple.com and found, its not reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants