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.
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
Output goes to stdout and stderr, and details the data rates and timings for each iteration.
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.