Thread View: comp.os.os2.programmer.misc
1 messages
1 total messages
Started by Keith Bennett
Fri, 12 Aug 1994 17:59
How to Detect Termination of Remote Process?
Author: Keith Bennett
Date: Fri, 12 Aug 1994 17:59
Date: Fri, 12 Aug 1994 17:59
33 lines
2433 bytes
2433 bytes
I have an app running which consists of, among other things, multiple program pairs, each consisting of 1 instance of a server process (let's call it S) and a client process (C). All the S processes run on the LAN Server server. One of the C processes runs on the server machine, and the others on their own client PC. Within S, I need to know if C is still alive or has died. What would be the best way to do this? These processes communicate via named pipes. My understanding was that when the client process dies, the pipe connecting it is broken. So I did a loop where I would check the return value from DosPeekNPipe() and sleep for n seconds. When it returned ERROR_BROKEN_PIPE, I assumed that the client process has died. This worked fine until I tested the client/server pair that both resided on the server. DosPeekNPipe() continued to return 0 even after the client process was gone. Can anyone tell me why this happened and if there is a better way to do what I am doing? The server program can detect whether or not its client partner is local. Perhaps I could use an event semaphore for a local client and continue to use the pipe for remote clients. However, I would like to keep it clean and figure out why the pipe isn't working locally. Any feedback greatly appreciated. - Keith -- -------------------------------------------------------------------------- Keith Bennett Bennett Business Solutions, Inc. C++/C Software Development 1852 Middlebridge Drive kbennett@cpcug.org Silver Spring, MD USA 20906
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads