Closed
Description
The following will remain open as long as the client makes a request within one second intervals making it possible that a server will never gracefully close. With the default of 2 minute timeouts a user or api client would need to stop traffic for two minutes before this will take affect. I propose closing sockets using keep alive immediately after the next request. This will prevent needing to keep track of everything that would need to be closed while making the maximum time to gracefully shutdown fixed(and finite).
var http = require('http');
var server = http.createServer(function(req, res) {
res.end('test\n');
server.close()
}).listen(8000, '127.0.0.1');
server.setTimeout(1000);