how to break out of FCGX_Accept_r
Andrej van der Zee <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I would like to know if it is possible to break out of the pending accept-call and how to do this. The problem is, I have to shutdown the fast-cgi after it has been runnig for 8 hours. In c++, when I schedule a threat that wakes up after 8 hours, the fast-cgi main-loop can be in two situations: 1) It is handling a request. In this case the fast-cgi should finish after handling it. This can be done with FCGX_ShutdownPending(). No problem here. 2) The main-loop is in FCGX_Accept_r waiting for an incomming connection. In this case I would like to break out of the accept and immideately finish the fast-cgi application. In the threat that wakes up after 8 hours, I was thinking to raise a signal in case 2 only. Though, how can I be sure that we are in case 2? Setting flags before entering and after leaving FCGX_Accept_r is not sufficient because my treat may wakeup when fast-cgi already accpeted a request, but has not come out of FCGX_Accept_r yet. Any ideas? Any other solutions? Thanks a bunch! Andrej ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/