Giter VIP home page Giter VIP logo

ios-ntp's Introduction

ios-ntp

An application testbed and a network time protocol client for iOS. This is a work in progress.

Created by Gavin Eadie on Oct 17, 2010

About

The clock on an iPhone, iTouch or iPad is not closely synchronized to the correct time. In the case of a device with access to the telephone system, there is a setting to enable synchronizing to the phone company time, but that time has been known to be over a minute different from UTC.

In addition, users may change their device time and severely affect applications that rely on correct times to enforce functionality.

This project contains code to provide time obtained from standard time servers using the network time protocol (NTP: RFCs 4330 and 5905). The implementation is not a rigorous as described in those RFCs since the goal was to improve time accuracy to with in a second, not to fractions of milliseconds.

This Fork

This is a fork from the original source at http://code.google.com/p/ios-ntp/ that provides ios-ntp as a static iOS framework. This makes its use easier and avoids symbol clashing.

Why fork? Well, because git and github are much more convenient than google code for me. I (jbenet) am subscribed to the RSS feed of the original project and will merge any upstream changes.

License

The MIT License Copyright (c) 2012, Ramsay Consulting

Usage

Download ios-ntp.tar.gz, and add ios-ntp.framework to your project. Make sure the file ntp.hosts is added to the project. I should show within the ios-ntp.framework/Headers directory.*

This project depends on CocoaAsyncSocket, so you may need to get it. ios-ntp only needs AyncUdpSocket.

Edit ntp.hosts to add or remove any NTP servers. Make sure it is OK to use them.

Then, simply call:

[NSDate networkDate];

As soon as you call it, the NTP process will begin. If you wish to start it at boot time, so that the time is well synchronized by the time you actually want to use it, just call it in your AppDelegate's didFinishLaunching function.

  • Note: The ntp.hosts is currently inside Headers to both bundle it with the framework AND coax Xcode to automatically add it, as it does not add the Resources directory of frameworks.

Building

To build the static framework, build the ios-ntp target from the xcode project. Make sure you build BOTH the iPhone Simulator and iOS Device architectures.

ios-ntp's People

Contributors

jbenet avatar bassrock avatar stevestreza avatar

Stargazers

Amit Kumar avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.