Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Window Close / Process Termination Handler on Windows

by rminner (Chaplain)
on Aug 29, 2018 at 21:28 UTC ( [id://1221324]=note: print w/replies, xml ) Need Help??


in reply to Re: Window Close / Process Termination Handler on Windows
in thread Window Close / Process Termination Handler on Windows

Hello Marshall,

Replacing the console window with a gui window would indeed solve the problem. Another solution would be to convert it into a daemon and writing a gui client to display the status messages.

The reason why i am not doing any of this is, that the program itself is an interim kludge for a closed source CTI (computer telephony interface) program which is used in a hotline. The hotline software fails to display basic things which one would expect of such a software, such as who is logged in, what their status is, what the call statistics are (SLA), and so on. The kludge which i quickly whipped up a few year ago, is a simple tcp proxy reading the communication between the client and the server presenting the information above through printing it to the console whenever there is any change. There is no user interaction, it just displays the infos, and it updates frequently. The users do not get the impression of it being hung.

Then why did i want to add a handler for program termination? When a user is done, they will close the windows. So far so good. If they close however the tcp proxy before the client programm, then the logoff in the client programm will never reach the server, because the tcp proxy is down. With the given cti server software the hotline agent will still be active and receive call, thus causing failed call counts to go up. Reason being that an explicit logoff is required to be removed from the hotline rotation. My intent was to inject the logoff message into the tcp stream whenever the simple tcp proxy is closed, thus eliminating the problem. But for that i would have needed a working "close" or "destroy" handler.

Since this software is supposed to be retired soon, there is no point in investing time into a major rewrite. I would have just added the logoff, if there would have been an easy way to call it upon window destruction. If i started converting that quick and dirty kludge to a gui application, then i could immediately write a new GUI client for the CTI software, since i know enough about the protocol to do so. This would also eliminate the need for a tcp proxy. Considering however that it is a soon to be retired application with a small user base, i can not justify putting that much time into it.
  • Comment on Re^2: Window Close / Process Termination Handler on Windows

Replies are listed 'Best First'.
Re^3: Window Close / Process Termination Handler on Windows
by Marshall (Canon) on Aug 30, 2018 at 00:31 UTC
    Thanks for your reply.
    I see that you understood my suggestions and I see why they aren't appropriate for this specific situation.

    I saw a post suggesting using the Window "START" command in a .bat file. There might be some way to use that to solve your problem. I don't know at the moment.

    However now that the Monks know more about what you are doing, there is an increased likelihood of a simple solution, perhaps not a general solution, but a solution that will solve your specific problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1221324]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 13:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found