title: Graceful shutdown of a node.JS HTTP server
body: <p>Here is a simple webserver I am working on</p>
  
  <pre><code>var server = require("http").createServer(function(req,resp) {
      resp.writeHead(200,{"Content-Type":"text/plain"})
      resp.write("hi")
      resp.end()
      server.close()
  })
  server.listen(80, 'localhost')
  // The shortest webserver you ever did see! Thanks to Node.JS :)
  </code></pre>
  
  <p>Works great except for keep-alive. When the first request comes in, <code>server.close</code> gets called. But the process does not end. Actually the TCP connection is still open which allows another request to come through which is what I am trying to avoid.</p>
  
  <p>How can I close existing keep-alive connections? </p>