http-shutdown
http-shutdown copied to clipboard
Fire shutdown callback only after closing all connections
Currently, shutdown callback called almost immediately after calling server.shutdown()
(by process.nextTick
). It seems that more desirable behaviour would be to wait for all connections to close to give shutdown-handling code better idea on when to close other resources that may be further used by not yet closed connections.
New to this stuff, but my interpretation is that it's called as part of the server.close
callback, which means it's called after the "server is finally closed". After initiating the close, this code then does it manual tweaking of idle sockets, thus helping the server.close
to finish.