If you include AbxProcessPeekApp in your packaged image, it will start up automatically when your application starts. Upon starting up, it will listen on some port (see below for information on choosing the port). When a client connects to that port, the client is expected to send a string and then disconnect. The string denotes the name of the file where AbxProcessPeekApp will dump the state information. If you choose the name of an already existing file, that file will be overwritten. The userid that started your Smalltalk application must have permission to write to the file that the client names.
Any errors that occur in the AbxProcessPeekApp will cause a message to be written to the Transcript. If you wish, you can change this behavior by modifying AbxProcessPeekSocketListener>>#reportError:.
By default, the AbxProcessPeekApp will use port 7172. If you wish, you may select a different port by adding two lines to your .ini file. The following lines will change the port for AbxProcessPeekApp to 8000:
[AbxProcessPeekSocketListener] PortNumber=8000
The output file contains information about all of the sockets that are currently managed by your Smalltalk application and also information about all current processes. Depending on the behavior of your application, the size of the file generated by AbxProcessPeekApp can vary between around 30K to 500K or more in extreme cases.
You can shut the listener down by sending the string "**SHUTDOWN**" in place of a filename. The method AbxProcessPeekSocketListener class>>#killDefault will accomplish this. You can start the listener with the method AbxProcessPeekSocketListener class>>#onPort:.
You can send messages to your application that includes AbxProcessPeekApp with the class AbxProcessPeekSocketClient. For example, execute the following code to cause an application with AbxProcessPeekApp at address 99.98.97.96 on port 7172 to dump its state to the file "/tmp/peekOutput":
You can create a command line client for peek by compiling peek.c. See the comments at the top of this file for instructions for how to build it. peek.c has only been compiled and tested on AIX; you will likely need to change it for other platforms.
The result of this compilation, peek, is a simple command line utility that acts as a client to AbxProcessPeekSocketListener. You provide peek with a filename and a port (optional) on the command line. For example, if you are using the default port (7172), invoke peek as follows:
peek /tmp/myDumpFile
If you have chosen a different port, say 8000, invoke peek as follows:
peek -p 8000 /tmp/myDumpFile
You can also use peek to shut down the AbxProcessPeekApp process in your running Smalltalk application by sending the stop code string as follows:
peek **SHUTDOWN**
You cannot use the peek client to restart the AbxProcessPeekApp.
You must run peek on the same machine that your Smalltalk application is running on. Once peek has completed, it will write a success or failure message to standard out.