Re: How to gracefully (programmatically) kill an app?
- From: "Ed Weir \(ComCast\)" <Anon@xxxxxxxx>
- Date: Wed, 30 Aug 2006 13:01:43 -0700
"Ajay Kalra" <ajaykalra@xxxxxxxxx> wrote in message
news:1156959882.587296.82630@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
| Tom Serface wrote:
| > Sorry, I didn't pick up on that part, but after rereading the post I
noticed
| > they did say they were closing the command window. Maybe OP could do
| > something similar by hooking into the Ctrl+C (break) handler???
| >
|
| That is mentioned in the docs but there has to be something generic for
| closing the console window (I think its different than Ctrl+C). I was
| hoping Joe will jump on this one.
|
| ---
| Ajay
This is something I have dealt with many times... please allow me
The way I did it was to create a global named event and signal it when I
want the server application to stop accepting connections. Another event is
signaled when an immediate stop is required which forces all open sockets to
close as well as rejecting new connections. As long as the first event is
signaled new connections are rejected, and when the second event is signaled
the application will terminate after closing all sockets. The rationale is
that server file maintenance can be done with the first event and a full
shutdown can be done with the second event. When the first event is reset
then the application will again accept new connections.
HTH...
-- Ed.
-----------------------------------------------------
In dictatorships, you need courage to fight evil; in the free world, you
need courage to see the evil."
—Natan Sharansky
F9E7707A2AF502D0A899C6ACB43A2D35EB7E->bin->b64
.
- Follow-Ups:
- Re: How to gracefully (programmatically) kill an app?
- From: Ajay Kalra
- Re: How to gracefully (programmatically) kill an app?
- References:
- Re: How to gracefully (programmatically) kill an app?
- From: Tom Serface
- Re: How to gracefully (programmatically) kill an app?
- From: Ajay Kalra
- Re: How to gracefully (programmatically) kill an app?
- From: Tom Serface
- Re: How to gracefully (programmatically) kill an app?
- From: Ajay Kalra
- Re: How to gracefully (programmatically) kill an app?
- Prev by Date: Re: Hitting the Enter Key While in Edit Boxes..
- Next by Date: Re: Hitting the Enter Key While in Edit Boxes..
- Previous by thread: Re: How to gracefully (programmatically) kill an app?
- Next by thread: Re: How to gracefully (programmatically) kill an app?
- Index(es):
Relevant Pages
|
Loading