libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Request for documenting MHD_quiesce_daemon


From: Rafał Miłecki
Subject: [libmicrohttpd] Request for documenting MHD_quiesce_daemon
Date: Sun, 28 Sep 2014 15:30:29 +0200

Hello MHD devs/fans :)

I was trying to find a way to cleanly shutdown my HTTP server. I
wanted to stop accepting new connections and then wait up to few
seconds for the active ones to be closed.

Initially I wanted to implement it on my own, but then I found out
there is no way to get amount of active connections. Ofc it's open
source, so I found appropriate patch:
http://lists.gnu.org/archive/html/libmicrohttpd/2012-02/msg00004.html
but I didn't really want to require patched libmicrohttpd.

Then I accidentally found out there is something called
MHD_quiesce_daemon. Unfortunately it's poorly documented and I'm not
sure if this is what I want at all.

Could you document this function, please? I think it could be described in the
5 Starting and stopping the server
chapter of the manual.

This would be more than great to also provide some example in the tutorial:
http://www.gnu.org/software/libmicrohttpd/tutorial.html

My guess (after reading daemon.c) is that I need to call:
1) MHD_quiesce_daemon
2) MHD_stop_daemon
3) MHD_socket_close_
is that correct? Is there any way to check at some point, if there are
any remaining connections? Let's say I call MHD_quiesce_daemon, then
I'd like to wait up to 60 seconds for all connections being closed.
Obviously, if they will be closed after 5 seconds (out of 60), I want
to quit earlier. Is this possible with the provided tools?

Thanks for the great library and your work on this :)

-- 
Rafał



reply via email to

[Prev in Thread] Current Thread [Next in Thread]