Help Index
Time Client Help Index

Commands

Host

Procedures

Installing

Operation

Glossary

Defined Terms

Legal Stuff

Copyright


Host Menu

The Host menu includes commands that enable you to customize the functioning of the time client.

For more information, select the Host menu command name.

Open

Setup

Exit

In addition the previous five or fewer hosts that were opened will be present.  Every time a host is opened, it will be added to the Host menu.  The last host in the list will be removed if there are already five hosts in the menu.


Host Setup Command

This command allows the user to customize the functioning of the time client using the setup dialog box.  The OK push button will save the current settings in an INI file and exit the Setup dialog, while the Cancel push button will restore the previous settings and exit the Setup dialog box.

The Open push button will use exit the Setup dialog and use the specified settings to attempt to retrieve the time from the default host specified in the Setup dialog.

For more information, select the dialog control name.

Time Server

Time Correction

UDP Retry

UDP Timeout

Use TCP Connection

Update system time


File Exit Command
Host Exit Command

This command will close the time client.  If there are open connections, then you will be warned about this fact by a dialog box.  If you select the OK button then the connection will be terminated, while selecting the Cancel button will abort the exiting.

If there are no active connections, you will simply be asked if you are sure that you wish to terminate the time client.


Setup time host

You should enter the name or the IP address of the host that you wish to connect to with the time client.  This name will be saved in an INI file so that the next time you start the time client you can connect to the same host simply usind the Host Open command.

You have to enter a host name, or IP address to make the Open menu item available.


Snark
Host Open Command

This command will attempt to connect to the host that was specified in the Setup dialog, and if a successful connection could be made, will get the current time from the server.

If Update system time was checked, then the local system's time will be updated after the optional correction factor has been applied.

See Also:


Time correction
Time correction factor

This entry is the number of seconds that should be added to the time that is returned from the time server.


Use TCP connection

This checkbox specifies if the time client should use a TCP or UDP connection when attempting to connect to the remote time server.  If the checbox is un-checked, then the UDP parameters become modifiable.

See Also:

UDP connection


Transmission Control Protocol
Transmission Control Protocol (TCP)

A connection-oriented protocol that provides a reliable, full-duplex, byte stream for a user process.  Most Internet application programs use TCP.  Since TCP uses IP the entire Internet protocol suite is often called the TCP/IP protocol family.

See Also:

UDP

TCP


User Datagram Protocol
User Datagram Protocol (UDP)

A connectionless protocol for user processes.  Unlike TCP, which is a reliable protocol, there is no guarantee that UDP datagrams ever reach their intended destination.  As a result, the client will not be able to know whether the server has received the request, and will re-send the request if a response from the server does not arrive within a timeout window.


UDP Re-transmission/Timeout

If a UDP connection is going to be used to connect to the time server, then two  extra parameters are needed.  The maximum number of times that the client will request the time from the remote server, and the maximum timeout.

If the client does not receive a response from the time server with in a certain time-out period, the client will re-send the request.  The algorithm used to determine the timeout is based upon an exponential backoff.

The re-transmissions occur according to the following table

Timeout	Re transmission
3 sec	none
6 sec	1st
24 sec	2nd
192 sec	3rd
3072 sec	4th

If the timeout is larger than the time given in the maximum UDP timeout, then the timeout will be reduced to the value specified, and no further re-transmission attempts will be made.


Internet Protocol
Internet Protocol (IP)

IP is the protocol that provides the packet delivery service for TCP, UDP and ICMP.  User processes normally do not need to be involved with the IP layer.


Update system time

Specifies if the time client should set the local system's time to the value that the time server returned after the correction factor has been applied to the time returned.


Installing Time Client

In order to use the Time client, you must have installed a Windows Sockets WINSOCK.DLL which conforms to version 1.1 of the Windows Sockets specification.  The time client will attempt to connect to a specified time server on a socket.

You should add the line TZ=EST5EDT to your autoexec.bat file.  This line will add the TZ environment variable, which will allow the time client to determine the timezone, and whether daylight savings time should be applied.

To install the Time client:

 1.  Place the executable and support files in their separate directory \NTIME.  Copy CTL3D.DLL to the Windows \SYSTEM directory, if a copy is not already there.

 2.  Start the File Manager and select the executable, and drag it to the program group that you wish to place it in.

 3.  Now execute the program.  Use the Setup command in the File Menu to configure the client.  You should specify whether you wish to use a TCP connection, and the time correction factor.

 4.  If you wish to have the time client automatically execute when you start Windows, then also place a copy in the Startup program group.  Modify the program properties to specify the time server and correction factor on the command line (i.e. "WSNTIME.EXE host.domain 12").

 5.  Now double click on the Time client icon to execute it to verify that it is working properly.


TZ Environment variable

This is the format of the TZ environment variable:

TZ = zzz[+/-]d[d][lll]

Component	What It Represents
zzz	Three-character string representing the name of the current time zone.  All three characters are required.
[+/-]d[d]	Required field containing an optionally signed number with 1 or more digits.  This number is the local time zone's difference from GMT in hours.
	-  Positive numbers adjust westward from GMT.
	-  Negative numbers adjust eastward from GMT.
lll	Optional three-character field that represents the local time zone's daylight saving time.

If the TZ environment string isn't present or isn't in the specified form, the presumed default is TZ=EST5EDT.


Time Socket

The socket to be used by the finger service can be specified in the services file.  The time service listens to a socket value of 37 is used.  The time protocol can use either a TCP or UDP connection.


Glossary

IP

TCP

UDP

Winsock


Winsock
Windows Sockets

The Windows Sockets specification defines a network programming interface for Microsoft Windows which is based on the "socket" paradigm popularized in the Berkeley Software Distribution (BSD) from the University of California at Berkeley.  It encompasses both familiar Berkeley socket style routines and a set of Windows-specific extensions designed to allow the programmer to take advantage of the message-driven nature of Windows.


Copyright NRC

 Finger Version 3.1, a Windows Sockets Finger Client

 Copyright 1992, 1993 Network Research Corporation by Lee Murach

Permission to use, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation.  NRC makes no claims as to the suitability of this software for any purpose.


Copyright notice

Time client version 1.00, a Freeware Windows Sockets Time Client

Copyright (C) 1994 Frederick W. Bent.

All rights reserved.

Portions Copyright 1992, 1993 NRC, by Lee Murach

Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by Frederick W. Bent.  In addition, if you wish to distribute this program in source and/or binary forms with other samples of WinSock programs, you must first contact the author so that I can keep accurate records of its usage.  The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. Specifically, do not modify this source in any way and re-distribute it without the author's prior consent.  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OF IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.


Modified re-distribution

I do not wish to have modified sources re-distributed as being authored by Frederick W. Bent, or "hacked" or "mis-behaving" versions of this program appearing.


History

I started out using FINGER (Lee Murach), but the final product bears little resemblance to FINGER.   All source code for the Time client is included, all I ask is that if you use this program, please drop me a email message (vorlon@hookup.net) with some comments on the program.  If you wish, and really feel the need, you can even send me $, since dial-up Internet SLIP access is not cheap.

However, I do not want the headache of supporting this program, which is why I created this help file.  But what I hope for is that MS-Windows programmers who wish to create public domain or Freeware WinSock software can use this code as a guide for creating other WinSock programs.  You can create commercial/shareware programs, but you MUST abide by the distribution agreement in this software's copyright.

 - Fred Bent

vorlon@hookup.net

fwbent@vorlon.hookup.net

Mailing address:

Frederick W. Bent

R.R. # 7 Stn Main

Guelph, Ontario  N1H 6J4

CANADA.

Bibliography/References

Postel, J. and Harrenstien, K., "Time Protocol", RFC 868, 2 pages, May. 1983.

Stevens, W. Richard, "UNIX network programming", Prentice-Hall Software Series, Englewood Cliffs, N.J., 1990.  ISBN 0-13-949876-1.

Trademarks

Windows is a registered trademark of Microsoft Corporation.

UNIX is a registered trademark of AT&T.


Operation
Operating Time Client

After a host name or address has been entered in the Setup dialog, you will be able to connect to the host.

To progress of the connection will be displayed in the work area of the time client.  The following example assumes that the time server is host.domain.

Resolving host.domain...

Trying host.domain...

[host.domain]

Time from host host.domain using TCP/IP = Sun Jul 31 09:17:39 1994 EDT

If the client cannot connect to the host, the time client will time-out.  The TCP protocol time-out level is currently set to 31 seconds.  The value of the time-out can be adjusted using the Timeout entry in the time clients INI file.

The time client can also be run in automatic mode, which will simply use the command line arguments which specify the host name and an optional time correction factor.  The connection type will be what is specified in the Setup dialog.  In automatic mode, the local systems time will be updated if the connection was successful.


Command-line arguments

hostname [correction]

hostname	The host name or IP address of the time server to be used to get the time from.  This field is required.
correction	Optional.  The correction factor in seconds that should be added to the time returned from the specified host.


INI File
INI File entries

The entries in the .INI file used by the time client are the following:

[NetTime]

UseTCP=1

TimeServer=host.domain

AddSeconds=0

UpdateSysTime=0

TCPTimeout=31

UDPTimeout=192

UDPRetry=3

Host1=

Host2=

Host3=

Host4=

Host5=

These values can be adjusted using the Setup dialog, accessible using the Host menu.