The XPA source code directory contains two test programs, stest.c, and ctest.c that can serve as examples for writing XPA servers and clients, respectively. They also can be used to test various features of XPA.
To build these programs, execute:
make testallin the XPA source directory to generate the stest and ctest programs. (NB: this should work on all platforms, although we have had problems with unresolved externals on one Sun/Solaris machine, for reasons still unknown.)
The stest program can be executed with no arguments to start an XPA server that contains the access points: xpa1, xpa1a, xpa1c (containing sub-commands cmd1 and cmd2), and xpa1i. You then can use xpaset and xpaget to interact with these access points:
cat xpa.c | xpaset xpa1 # send to xpa1 cat xpa.c | xpaset "xpa1*" # send to xpa1 and xpa1a xpaget xpa1 # receive from xpa1 xpaget xpa1* # receive from xpa1 and xpa1aetc. You also can use ctest to do the same thing, or to iterate:
ctest -s -l 100 xpa1 # send to xpa1 100 times ctest -s -l 100 "xpa1*" # send to xpa1 and xpa1a 100 times ctest -g -l 100 xpa1 # receive from xpa1 100 times ctest -g -l 100 "xpa1*" # receive from xpa1 and xpa1a 100 timesMore options are available: see the stest.c and ctest.c code itself, which were used extensively to debug XPA.
The file test.tcl in the XPA source directory gives examples for using the XPA/Tcl Interface.