[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Using MHD_stop_daemon with signal() or elsewhere?
From: |
Gavin Henry |
Subject: |
Re: [libmicrohttpd] Using MHD_stop_daemon with signal() or elsewhere? |
Date: |
Mon, 24 Jan 2022 19:16:45 +0000 |
> Hi Gavin,
Hi Evgeny,
> Using graceful closure is one of the vital thing for correct
> implementation of any application.
Understood.
> Of course you *must* call MHD_stop_daemon() as it stops MHD threads,
> free memory, closes sockets, and does other cleanups.
Thanks. I understand closing the sockets, but the OS/kernel will do
all the rest no?
I need mhd always on until the application quits. What happens after
that the OS/kernel will sort.
> Not calling this function is like allocating memory without deallocating.
I don't think that's the same at all. MHD doesn't perform badly nor
does my application leak memory if I don't call MHD_stop_daemon(). It
restarts just fine.
> If your application is designed to work as systemd daemon, you must
> handle SIGTERM signal to properly close/free all resources before final
> exit.
Is there some guidance on that systemd requirement? Will Google.
Thanks.
--
Kind Regards,
Gavin Henry.
https://sentrypeer.org