http-shutdown icon indicating copy to clipboard operation
http-shutdown copied to clipboard

Fire shutdown callback only after closing all connections

Open rmdm opened this issue 7 years ago • 1 comments

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.

rmdm avatar May 09 '17 14:05 rmdm

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.

CapnSpellcheck avatar Nov 03 '17 05:11 CapnSpellcheck