Kbase P3262: How to stop a 4GL program running as an NT service?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  27/09/2002 |
|
Solution ID: P3262
GOAL:
How to stop a 4GL program running as an NT service?
FACT(s) (Environment):
Progress 9.x
Windows NT 32 Intel/Windows 2000
FIX:
Make a custom stop service program based on socket events as illustrated below:
1) In the 4GL program run as a service, implement a mechanism based on socket programing to wait for a socket event that fires a 4GL QUIT. This will end the session smoothly.
2) Make a 4GL stop service program to:
A) Send the waited socket event.
B) Wait for a while.
C) Do a 'NET STOP' with an OS-COMMAND in order to notify NT that the service has been stopped.
D) QUIT.
E) If desired, make a shortcut with an appropriate icon to run this stop program.
3) Windows will then be notified that the service has been stopped. The only difference is that pressing the 'stop' button will not be as nice as launching the stop program regarding the disconnections from databases and how shared resources such as DLLs are released.