Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shutdown and EXE
Message
 
 
To
01/05/2009 14:45:59
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01397454
Message ID:
01397496
Views:
37
>>>>>I have a compiled EXE that serves to produce PDF output from a website. Occassionally it runs into trouble when the parameters sent to it produce a nonsensical query and it hangs or crashes. This leaves an instance running on the webserver that gets in the way of replacing the EXE with a newer version until IIS or even the server box is rebooted. I'm trying to devise a way to cause the EXE to shutdown in the event of an error or if it gets caught in an infinate loop. Thoughts include some type of timer setup and/or a "QUIT" in the catch section of a try/catch sequence.
>>>>>
>>>>>Thoughts or ideas?
>>>>>
>>>>>Thanks
>>>>
>>>>You can always kill your executable.
>>>
>>>Ah yes. I was just wondering about the best way to trigger the kill.
>>
>>Well, your application has to have some error handler that will close the application. You can check Remote Debugger from the Downloads section here, though it has some interactive interface. Also my former colleague Mike Asherman designed error handler, but I'm not sure about how easy it would be to plug into the existing app.
>>
>>The simple way could be to add to your main program
>>
>>on error do ErrorHandler with error(), message() etc. and then have this routine to exit gracefully.
>
>I have a try/catch that assembles an error message and returns it to the webpage when the routine has an error. But what about an infinate loop? In this case there isn't technically an error that would trigger the error handler. The program just goes off and never comes back. So I think I need a timer somehow. But how to add it to the custom class of the EXE and would it even work if the function was stuck in a loop?

Well, there could be a main timer (say, the one by Bella Bodecs), that can check the memory used by application and kill it when you reach the certain maximum. I never programmed against the infinitive loop this way (may be because my programs don't go into such loops?), so this is just a general idea.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform