[AWS] Clean Termination

henrik.sundberg at saabsystems.se henrik.sundberg at saabsystems.se
Thu Sep 16 16:44:59 CEST 2004


I solved this by adding a semaphore (protected type).
The line after the start of the server just waits for the semaphore, and
after that shutdown is called.
My callback handler signals the semaphore when shutdown is requested
through the web-page.
I also installed a ctrl-c handler that just signals on the same semaphore,
to be able to stop the server nicely from the command prompt, with ctrl-c.

      /Henrik Sundberg



|---------+------------------------------->
|         |           "Ian Broster"       |
|         |           <ian at broster.co.uk> |
|         |           Sent by:            |
|         |           aws-bounces at lists.ac|
|         |           t-europe.fr         |
|         |                               |
|         |                               |
|         |           2004-09-16 16:13    |
|         |                               |
|---------+------------------------------->
  >-------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                         |
  |        To:      aws at lists.act-europe.fr                                                                                 |
  |        cc:                                                                                                              |
  |        Subject: [AWS] Clean Termination                                                                                 |
  >-------------------------------------------------------------------------------------------------------------------------|




Is there a nice way to cleanly terminate a server, externally from
a request? That is, the request must complete and return a page
to the browser before the server shuts down?

Calling shutdown from within the request does not return
a page, and other hacky methods (timeouts, monitoring ports etc)
are just that.

ian


--
Dr Ian Broster
_______________________________________________
AWS mailing list
AWS at lists.act-europe.fr
http://lists.act-europe.fr/mailman/listinfo/aws






More information about the AWS mailing list