VAStGoodies.com
Your VA Smalltalk OSS repository. Powered by
with
.
Configuration Maps
|
Projects
|
Tags
|
Developers
|
Statistics
|
RSS
|
Disclaimer
|
About
|
Help
Configuration Maps Browser
Configuration Map Names
Abt Image Startup
AbtOleEdit
AbxProcessPeek
Announcements Core
Announcements Demos Seaside
Announcements Tests
Announcements Tools VA
Cloudfork
Cloudfork ActiveItem
CloudforkAWS
CloudforkAWSWithTests
CloudforkSSO
CloudforkSSOWithTests
CodeManagement
ComputerTelephony
Compuware SplitterWidget
CounterMap
DhbNumerics
DhbNumericsWithTests
Flotr Core
FogBugz Support
GemStoneCodeManagement
GemStoneCodeManagement Mods
Glorp
GlorpTest
GlorpVAPortMap
Goodies - UML Designer
GreaseVASTExtensions
Highcharts Seaside Addon
HQA Automated Build Support
HQA Code Snapshot Tool
InstallService
JNIPort
JNIPort Tests
JokXTEAEncryption
JQuery-plugin Autocomplete
JQuery-plugin Bind
JQuery-plugin QTip
JQuery-plugin Radiobutton and Checkbox
JQuery-plugin Table Sorter
JQuery-plugin Table Sorter Example
JQuery/JQueryUI
JQuery/JQueryUI Tests
JQueryMobile
JQueryMobile Tests
JQueryWidgetBox Core
JQueryWidgetBox Dynatree
JQueryWidgetBox Examples
JQueryWidgetBox Portability Extentions
JQueryWidgetBox Tests
JSON
KscCase
KscDynamicSortBlock
KscEMail
KscInspectWindow
KscLibUsb
KscMZZipExtensions
KscShellNotifyIcon
KscViewExtensions
KscWeather
KscX10Base
KscX10LibUSB
KscX10LibUsbGui
LibGit
Magritte
Magritte Seaside
Magritte Tests
MagritteMagic
Mastering ENVY/Developer Refactoring Browser Extensions
Mastering ENVY/Developer Script Manager
MessagePack
MessagePack Tests
MetaTest Browser
MethodPragmas
MethodWrappers
MethodWrappers Tests
MethodWrappersBase
MFNLSManagement
MiniSMock
MinneStoreDB
Modelling
Monticello Importer - Beta
MQTT-Paho
MQTT-Paho Tests
MSKAdditionalColorSupport
MSKCLDTPrimitivesExtension
MSKCLDTPrimitivesExtensionWithTestsAndResources
MSKClick
MSKCouchDB
MSKCouchDBWithTests
MSKCurlInterface
MSKDyBase
MSKDyBaseWithTests
MSKECLWrapper
MSKECLWrapperTestsAndResources
MSKFFLLInterface
MSKFischertechnikInterface
MSKFreeImageUI
MSKFreeImageWrapper
MSKFreeImageWrapperWithTests
MSKGeneralDatabase
MSKGhostscriptInterface
MSKGLibWrapper
MSKGLibWrapperWithTests
MSKICU
MSKICUAndTests
MSKICXDLibHaruDM
MSKICXDTNetStringsDM
MSKICXDTNetStringsTests
MSKJSONWrapper
MSKJSONWrapperWithTests
MSKLibHaruInterface
MSKLogging
MSKLua
MSKLuaWithTests
MSKMdlPlainRuntime
MSKMonoInterface
MSKMSAgentWrapper
MSKOleAdditions
MSKOOBaseDLLWrapper
MSKOOoAutoGenerated
MSKOOoBaseLibrary
MSKOOoCodeGenerator
MSKOOoExamplesAndIDE
MSKOOoSmalltalkExtensions
MSKOpenCLSupport
MSKOpenGLSupport
MSKOpenGLSupport Core
MSKOpenGLSupport Examples
MSKOpenGLSupport Examples FreeImage
MSKOpenGLSupport GUI
MSKOpenGLSupport Runtime Loading
MSKOpenGLSupport Structures
MSKPlatformExtension
MSKPostgreSQL
MSKPostgreSQLAbtDBMLayer
MSKPostgreSQLAbtDBMLayerWithTests
MSKPostgreSQLWithTests
MSKProcessViewer
MSKRaphaelExtensions
MSKRemoteCommandTools
MSKResourceManagement
MSKResourceManagementRuntime
MSKRexxSupport
MSKRexxSupportWithTests
MSKScintillaWrapper
MSKSDL
MSKSDLWithTests
MSKSeasideNLSExample
MSKSeasideNLSExtension
MSKSeasideSimpleREST
MSKSnarlInterface
MSKSQLite
MSKSQLiteAbtDBMLayer
MSKSQLiteGlorpSupport
MSKSQLiteWithTests
MSKSyslog
MSKSystemExtension
MSKSystemGraphicsExtension
MSKTestModel
MSKTreBinding
MSKTreBindingWithTests
MSKUDPMulticast
MSKUREWrapper
MSKVectorExtension
MSKVectorExtensionsWithTests
MSKZLibWrapper
MSKZLibWrapperWithTests
Mustache
NeoCSV
NeoJSON
Obdobion, EMan - Developer
Obdobion, EMan - Distribution
Obdobion, EMan - Examples
Obdobion, EMan - Runtime
OGLogger
Philemon Event Support
Philemon Melissa
Philemon TaggedData
Philemon Tools
Pier
Pier Add-ons
Pier Seaside
Pier Seaside Tests
Pier SIXX Persistence
Pier Tests
PUMRESTRuntime
QuotedPrintableCoderRun
QuotedPrintableCoderWithTests
Raphaël - JavaScript Library
Raphael - JavaScript Library Examples
RaspberryHardwareInterfaceCore
RaspberryHardwareInterfaceTest
RaspberryHardwareInterfaceViaDaemonTest
Reef
Refactoring Browser
Refactoring Browser Model
RefactoryTesting
Regex
Roassal
Roassal-Core
Seaside Core
Seaside GoogleChart
Seaside REST
Seaside REST Tests
SeasideGoogleMapsV3
SeasideGoogleMapsV3Examples
SimGeohash
Simple GBS Temperature Sensor Example
Simple Improvements
SIXX
SIXX Tests
SpsPdfLib
SpsPdfLib Development
StOMP
StOMP Tests
STON
StsBrowsersWin w/Code Completion
SUnit
SUnit Browser
SUnit Browser - Packagable
SUnit Tests
SWFObject2 Seaside Addon
SWFObject2 Seaside Addon Demo
Test Browser
Toothpick
TwitterBoostrapForSeaside
TwitterBootstrapForSeasideExamples
TwitterBootstrapForSeasideTests
USAstronomicalApi
VA Assist Pro for TrailBlazer
VAStGoodies.com Tools
VBRegex
WinCrypt
WinCryptWithTests
WinHttpClient
WinHttpClientWebServiceSupport
WinHttpClientWebServiceSupportWithTests
WinHttpClientWithTests
z.ST: Database, PostgreSQL-Base
z.ST: SUnit
z.ST: SUnit Testing
Zstandard
Zstandard Tests
Versions
Download
1.07
1.06
Applications
AbxProcessPeekApp 1.07
Config. Expressions
Required Maps
Find
Notes
Change History: 1.07 - Improved output for dumped Processes 1.06 - First version on VAStGoodies Description: 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 AbxProcessPeekCommunications>>#reportError: and/or AbxProcessPeekDumper>>#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: [AbxProcessPeekApp] SocketListenerPortNumber=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:. AbxProcessPeekSocketClient (Smalltalk client) ------------------------------------------------------- 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": (AbxProcessPeekSocketClient connectToServerAtAddress: '99.98.97.96' port: 7172) sendMessageToListener: '/tmp/peekOutput' peek (c client) ------------------ You can create a command line client for peek by compiling peek.c (below). 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. ---------- CUT ---------- /* peek.c * peek utility for use with the Smalltalk AbxProcessPeekApp application. * Compile with the command: cc -o peek peek.c. */ #include <sys/socket.h> #include <netinet/in.h> #include <sys/errno.h> #define DEFAULT_PORT 7172 void printUsage() { printf("usage: peek [-p portnum] filename\n"); } int getPortNum(char *argv[]) { int port; if (strcmp(argv[1], "-p") !=0) { printf("Invalid option: %s\n", argv[1]); return -1; } port = atoi(argv[2]); if (port < 1) { printf("Invalid port given\n"); return -1; } return port; } int sendPeekRequest(int port, char* fileName) { int sockfd; struct sockaddr_in servaddr; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { printf("socket error: %d\n", errno); return -1; } memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(port); if (inet_addr(AF_INET, "127.0.0.1", &servaddr.sin_addr) < 0) { printf("inet_addr error: %d\n", errno); return -1; } if (connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) < 0) { printf("connect error: %d\n", errno); return -1; } if (write(sockfd, fileName, strlen(fileName)) < 0) { printf("send error: %d\n", errno); close(sockfd); return -1; } close(sockfd); return 0; } void main(int argc, char *argv[]) { int port; char *fileName; int i; if ((argc != 2) & (argc != 4)) { printUsage(); exit(1); } if (argc == 4) port = getPortNum(argv); else port = DEFAULT_PORT; if (port == -1) { printUsage(); exit(1); } fileName = argv[argc - 1]; if (sendPeekRequest(port, fileName) < 0) printf("Unable to send request to port: %d, filename: %s\n", port, fileName); else printf("Sent request to port: %d, filename: %s\n", port, fileName); } ----- CUT ----- License Agreement for VA Smalltalk Goodies ---------------------------------------- Instantiations is pleased to provide sample code and utilities (hereinafter, the "Code") to you for your use free of charge, subject to the following terms and conditions, which apply no matter how you may have obtained the Code. Instantiations grants you a royalty-free license to use, copy, distribute and modify the Code, but the Code may not be sold or licensed for a fee. You may also grant others the right to do the same. You understand that the Code is not supported by Instantiations in any manner, and that the Code is being provided AS IS, without a warranty of any kind. Instantiations does not warrant that the Code will meet any requirements that you may have or that the operation of the Code will be error free. Further, this license and the Instantiations copyright notice (see below) must be included with all copies of the Code that you make or distribute. Copyright (c) Instantiations, Inc., 2010. All rights reserved. Copyright (c) IBM Corporation, 1995, 2000. THIS DOCUMENT AND CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. INSTANTIATIONS DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND MERCHANTABILITY WITH RESPECT TO THE INFORMATION IN THIS DOCUMENT. BY FURNISHING THIS DOCUMENT, INSTANTIATIONS GRANTS NO LICENSES TO ANY PATENTS OR COPYRIGHTS.
Comment
Project:
AbxProcessPeek
Developer:
John O'Keefe
Use the
VAStGoodies.com Tools
to submit your contributions.