envos TCPTIME 2 4 1 TCPTIME 1 4 By: Christopher Lane (Lane@Sumex-Aim.Stanford.Edu) Uses: TCP, TCPUDP TCPTIME implements time client and server routines under TCP/IP and UDP/IP based on RFC868. The following are the user functions; the PROTOCOL argument refers to one of TCP or UDP and defaults to the value of RFC868.DEFAULT.PROTOCOL, initially TCP. All arguments are optional: (RFC868.SETTIME [RETFLG PROTOCOL]) [Function] Obtains the time from the network, similar to the \PUP.SETTIME and \NS.SETTIME functions. If RETFLG is non-NIL, the time is returned as an integer (as specified in RFC868), otherwise SETTIME is called and the new time is printed in the prompt window. Either TCP.TIME.HOSTS and/or UDP.TIME.HOSTS (see below) must be set before calling this function. (RFC868.START.SERVER [PROTOCOL ASCIIFLG]) [Function] Starts a network time server process for the specified (or default) PROTOCOL if one is not already running. The ASCIIFLG is discussed below. (RFC868.STOP.SERVER [PROTOCOL]) [Function] Deletes the network time server process for the specified (or default) PROTOCOL if one is running. The following variables are used by the functions above: RFC868.TIME.PORT = 37 [Variable] Used to set the initial value of the protocol specific port variables when the file is loaded. Once the file is loaded, changing this variable has no effect, so it must be reset (if necessary) before loading the file, otherwise the protocol specific port variables should be reset directly. See TCP.TIME.PORT and UDP.TIME.PORT below. RFC868.DEFAULT.PROTOCOL = TCP [Variable] The default protocol to use when one is not specified. BINARY & ASCII TIME FORMAT Some network software implements the RFC868 standard by returning the printed (ASCII) representation of the time, rather than the binary representation as specified in the RFC. To work around this, the ASCIIFLG can be specified when starting a server to indicate that it should output the printed representation of the number. Similarly, when getting the time from the network, the following is used: RFC868.ASCII.OSTYPES = (VMS) [Variable] to decide based on the host's operating system whether to read the time as a binary or ASCII number. If this variable is set to NIL, the ASCII format is never used. The ASCII format is currently only supported in the TCP protocol. PROTOCOL SPECIFIC FUNCTIONS (TCP.SETTIME [RETFLG]) [Function] (UDP.SETTIME [RETFLG]) [Function] Functions called by RFC868.SETTIME which can be called directly. The variables TCP.TIME.HOSTS and UDP.TIME.HOSTS must be set to use these functions. (TCP.TIMESERVER [ASCIIFLG]) [Function] (UDP.TIMESERVER) [Function] Functions used by RFC868.START.SERVER. Can be used directly using ADD.PROCESS. TCP.TIME.PORT = RFC868.TIME.PORT [Variable] UDP.TIME.PORT = RFC868.TIME.PORT [Variable] The ports to use in both the client and server functions. TCP.TIME.HOSTS [Variable] UDP.TIME.HOSTS [Variable] Lists of host names and/or addresses (including broadcast addresses) to try to get the time from. Host are tried until one responds. TCP.SETTIME.TIMEOUT = 10000 [Variable] UDP.SETTIME.TIMEOUT = 10000 [Variable] Length of time (in milliseconds) to wait for a host to respond to TCP.OPEN or UDP.EXCHANGE before trying the next one on the list.(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "") STARTINGPAGE# 265) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))-T6T,,,,8,8H PAGEHEADING RUNNINGHEAD CLASSICCLASSICCLASSIC HELVETICA MODERN MODERN MODERN MODERNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN 5 A  ^   D %   G 9 P 6 A         P    :     z