You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is this the best way to stop accepting new connections before ending the existing connections/requests?
how are "idle" connections defined?
Node.js version
version 20+
Example code
constserver=app.listen(3900,'0.0.0.0',()=>{console.log('listening...');});process.once('SIGINT',()=>{console.log('got SIGINT.')setTimeout(()=>{console.log('ending process due to SIGINT + subsequent Timeout.')process.exit(0);},3000);server.closeIdleConnections();server.closeAllConnections();server.close(err=>{if(err){console.error(err);}console.log('closed server, and now shutting down due to SIGINT.')process.exit(0);});});
Operating system
darwin/linux
Scope
http
Module and version
http
The text was updated successfully, but these errors were encountered:
Details
Here:
https://stackoverflow.com/questions/78144749/using-node-js-how-to-stop-new-requests-before-closing-existing-ones
The question is:
Node.js version
version 20+
Example code
Operating system
darwin/linux
Scope
http
Module and version
http
The text was updated successfully, but these errors were encountered: