Closing down program

From: Lepi (lepi_MAKNI_ME__at_fly.srk.fer.hr)
Date: 09/22/04


Date: Wed, 22 Sep 2004 13:38:11 +0200

Hello

I have simple server program written in C. It works in endless loop.
What I need is, the special way to end it.
There should be two features:
1. It should be enabled that when I press CTRL+C, program calls my
function that does something before program ends.
2. I want timeout, so after 2 minutes, program also calls my function,
runs that function, and then ends.

Please it is very urgent..

Thank you in advanced...

Tom



Relevant Pages

  • Re: Threadpoollllll!!!! help
    ... For example, if the thread makes a call without a timeout, or has an endless loop, or long running query, it will tie up a thread for that amount of time. ... long period of time for a reason that i cant ...
    (microsoft.public.dotnet.general)
  • Re: [PHP] Alter an Array Key
    ... I'm not sure Roberts solution would work. ... in an endless loop, and timeout your script. ...
    (php.general)
  • Re: [RFC][PATCH] Make prepare_namespace() wait for devices
    ... backup kernel a system can recover from this. ... With your endless loop it can't. ... Always add some kind of timeout. ...
    (Linux-Kernel)
  • session timeout doesnt work
    ... In the web.xml descriptor file ... I set the timeout to be five minutes: ... However when I make an endless loop in the code the session do not ... How can I kill the session if this kind of loop occurs. ...
    (comp.lang.java.programmer)
  • session timeout doesnt work
    ... In the web.xml descriptor file ... I set the timeout to be five minutes: ... However when I make an endless loop in the code the session do not ... How can I kill the session if this kind of loop occurs. ...
    (comp.lang.java.programmer)