title: Node.js listen() throws 'EADDRINUSE' after server.close()
body: <p>I am trying to terminate cluster workers when they are not needed to free up some resources. Here is the code I use in worker:</p>
  
  <pre><code>server.on("close", function() {
      process.exit();
  });
  server.close();
  </code></pre>
  
  <p>This code is executed when the worker gets the command from master. The "close" callback IS called, but I can't access any ports that the workers were using. So I have this code</p>
  
  <pre><code>var server = require('http').createServer(function(req, res) {
      res.writeHead(200);
      res.end('');
  });
  server.listen(8080);
  </code></pre>
  
  <p>And if I restart the worker after it exits, I get 'EADDRINUSE' for the listen() on 8080 port.</p>