APING and APINGD

The sample code for APING and APINGD is ported from code on the IBM APPC/CPI-C disk. They are end-to-end connectivity testers; they simply show that the configuration is correct by exchanging bytes of data across the link. APING is the client or invoking (local) half and attempts to contact APINGD (the APPC/CPI-C ping daemon or server), which is written here as a Windows NT service so it can be installed as an invokable TP on the remote computer.

Setup

    To set up APING and APINGD
  1. Create an appropriate APPC LU-LU-mode triplet (for example, LUPING-LUPINGD-#INTER).
  2. Set up a CPI-C symbolic destination name that contains the configured remote LU and mode. (The TP name for APINGD is APINGD.)
  3. Assign the local APPC LU to the APING TP, either by using a registry entry of APING:REG_SZ:LocalLUAlias in the SnaBase\Parameters\Clients key, or by assigning the local LU as the default local APPC LU for the user who will run APING.

Input and Output

APING is a console application. The syntax of its command line is

aping [-ssize] [-iiterations] [-cpackets] [-mmode] [-ttpname] PartnerLUName

aping [-ssize] [-iiterations] [-cpackets] SymbolicDestinationName

where

-ssize
Specifies the size, in bytes, of the packet transmitted. The default is 100 bytes.
-iiterations
Specifies the number of iterations to carry out. The default is 2.
-cpackets
Specifies the number of consecutive packets sent by each side. The default is 1.
-mmode
Specifies the mode name. The default is #INTER.
-ttpname
Specifies the TP name of the TP to start on the remote server. The default is APINGD.
PartnerLUName
Specifies the partner LU name of the destination.
SymbolicDestinationName
Specifies the symbolic destination name of the destination.

Output goes to stdout and stderr, and details the data rates and timings for each iteration.

Operation

Note that with APINGD, Specify_Local_TP_Name is used to set the local TP name, so Wait_For_Conversation must be used to wait for the Accept_Conversation call to complete, since it will return asynchronously.

The code at the end of APINGD.C is a stub for making any TP into a Windows NT service. There are three routines that are needed: main, ServiceMain, and ControlHandler. See the comment in the file for details of how these work. The TPStart routine is the entry point of the TP proper.

In particular, note that in response to the SERVICE_CONTROL_STOP or SERVICE_CONTROL_SHUTDOWN messages in the ControlHandler routine, action should normally be taken to stop the service, but because each run does not last long with the samples, no such action is taken.