ComponentSpace Internet Time Class Library

Internet Time Class Library

Introduction provides an overview of the Internet Time Class Library.

Installation details the prerequisite system requirements and installation procedures for the Internet Time Class Library.

Reference documents the namespaces and classes that constitute the Internet Time Class Library.

Examples describes the included example code.

FAQ lists frequently asked questions.

Support describes how to get support.

Send comments on this topic.


Introduction

Retrieving the date and time from Internet time-servers has never been easier. With the Internet Time .NET class library you may retrieve the date and time using the Network Time Protocol (RFC-1305), the Time Protocol (RFC-868) or the Daytime Protocol (RFC-867). Times are returned as standard System.DateTime objects. These can be easily converted from UTC to local time. Written in 100% managed C# code, the class library offers .NET developers easy access to Internet time-servers from within their applications.

The Internet Time .NET class library may be used in any Windows or Web application by adding a reference to the assembly to access the classes in the ComponentSpace.InternetTime namespace.

The NetworkTimeClient class retrieves the date and time using the Network Time Protocol (NTP). You may retrieve the time either synchronously (blocking) using the GetTime method or asynchronously (non-blocking) using the BeginGetTime and EndGetTime methods. For asynchronous calls you may receive completion notification either through an event or a callback method. A timeout may be specified. The UTC date and time is returned as a System.DateTime object that easily may be converted to local time.

The TimeClient class retrieves the date and time using the Time Protocol. You may retrieve the time either synchronously (blocking) using the GetTime method or asynchronously (non-blocking) using the BeginGetTime and EndGetTime methods. For asynchronous calls you may receive completion notification either through an event or a callback method. A timeout may be specified. The UTC date and time is returned as a System.DateTime object that easily may be converted to local time.

The DaytimeClient class retrieves the date and time using the Daytime Protocol. You may retrieve the time either synchronously (blocking) using the GetTime method or asynchronously (non-blocking) using the BeginGetTime and EndGetTime methods. For asynchronous calls you may receive completion notification either through an event or a callback method. A timeout may be specified. The UTC date and time is returned as a string.

All classes that raise events support a SynchronizingObject property. All classes report errors through the InternetTimeException.

Features

  • Supports the Network Time Protocol (RFC-1305)
  • Supports the Time Protocol (RFC-868)
  • Supports the Daytime Protocol (RFC-867)
  • Receive the date and time as a System.DateTime object
  • Calling applications may make either synchronous or asynchronous calls
  • Asynchronous calls may either use events or callbacks
  • Specify a timeout
  • 100% managed code written in C#
  • Object oriented design specifically for the .NET framework
  • All error handling through .NET exceptions
  • Comprehensive Visual Studio .NET style documentation
  • VB.NET, C# and Web Service example source code
  • Includes prompt free email support
  • Royalty free runtime
  • Source code available

This class library may also be purchased as part of the ComponentSpace .NET Internet Suite.

Getting Started

  • Install the product in your development environment.
  • Compile and run one of the examples.
  • Refer to the reference section for further details.
  • Add a reference to the class library in your application.
  • Once completed, distribute the class library with your application.


Installation

To install this product double click the .MSI file and follow the installation steps.

Prerequisites

The Microsoft .NET framework runtime must already be installed on your computer. The Microsoft .NET framework redistributable may be downloaded from msdn.microsoft.com.

You will also need a development environment such as Visual Studio .NET.

Distribution

The class library's runtime is royalty free which means it may be freely distributed with your application. The only file that should be distributed is the class library's DLL.


Reference

The reference section is contained within a separate help file.


Examples

Example code, developed using Microsoft Visual Studio .NET, is included with the product. You will find these projects in sub-directories of the installation directory.

TestInternetTime
Demonstrates the use of the class library within a C# application. This example uses asynchronous invocation with event notification.
VBTestInternetTime
Demonstrates the use of the class library within a VB.NET application. This example uses asynchronous invocation with event notification.
InternetTimeWebService
Demonstrates the use of the class library within a Web Service. This example uses synchronous invocation. To run the example you will need to create a virtual directory within IIS.


FAQ

Frequently Asked Questions
  1. I can't build the examples. Why can't the ComponentSpace namespace be found?

    2. The assembly containing the namespace or the project referencing it has been moved. The simplest way to fix this is to re-add the reference to the project by browsing to where the DLL is located (typically the installation directory).

  2. How do I run the web service?

    3. The web service source code is installed on the file system but isn't configured within IIS. From within IIS you should create a virtual directory and point to the web service source directory. You should then be able to run the web service from within Visual Studio .NET and Internet Explorer.

  3. What are RFC-867, RFC-868 and RFC-1305?

    4. RFC-867 describes the Daytime Protocol. RFC-868 describes the Time Protocol. RFC-1305 describes the Network Time Protocol. All three protocols retrieve date and time information across the internet from time servers.

  4. Why does the DaytimeClient class return the time as a string rather than a DateTime?

    5. RFC-867 specfies the date and time are returned as a string with no specific format. The TimeClient and NetworkTimeClient classes return the date and time as a DateTime object.

  5. What time servers are available?

    6. Many organizations provide time servers. For a list of the NIST Internet Time Service servers refer to http://www.boulder.nist.gov.

  6. What if I'm behind a firewall?

    7. You may not have access to external time servers but, if this is the case, you would normally have access to a time server behind the firewall. Contact you network administrator.


Support

For further information, visit us at http://www.componentspace.com or send email to info@componentspace.com.

If have a bug to report or a product enhancement request send email to support@componentspace.com.