trot
trot copied to clipboard
Implement graceful shutdown
How can I implement graceful shutdown of the server?
I would like to capture SIGINT and SIGHUP signals and then I would like to stop listening for new connections. I would still like to process pending connections and after some TIMEOUT I would like to kill the server even if there are still some pending connections.
Can you help me in this matter?