Re: How to gracefully (programmatically) kill an app?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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

.



Relevant Pages

  • Re: How to gracefully (programmatically) kill an app?
    ... |> want the server application to stop accepting connections. ... As long as the first event ... In dictatorships, you need courage to fight evil; ...
    (microsoft.public.vc.mfc)
  • Re: Too Many Processes?
    ... > uses stored procedures extensively to access the data. ... I've been closing my connections after executing any data ... As long as you are correctly closing AND disposing of your objects when ...
    (microsoft.public.sqlserver.programming)
  • rblsmtpd/qmail-smtpd hung processes
    ... After a while the server just quits accepting smtp connections, or will connect/disconnect very quickly. ... Since I'm not seeing any log activity that shows what's going on, I'm having a hard time figuring it out. ... Our email/dns provider is closing up shop in about a week. ... I only had about 3 weeks notice on this and I've been configuring a pair of FreeBSD machines to take over DNS and E-Mail for about a dozen sites. ...
    (freebsd-questions)
  • RE: JDBC connections not closing
    ... | Thread-Topic: JDBC connections not closing ... | thread-index: AcTB1nv3W8xh6wDJQIK0wY6q4fuFig== ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Too Many Client tasks
    ... connections are open and who or what site has them open. ... I know that it is someone not closing their connection ... >> This is the error I see in the asp pages. ...
    (microsoft.public.inetserver.asp.db)