title: Programmatically stop and restart express servers (to change ports)
body: <p>I'm looking to be able to basically change ports that my express app is running on.</p>
  
  <p>I've tried:</p>
  
  <pre><code>server.on('close', function() {
    server.listen(3000);
  });
  
  server.listen(8080);
  server.close();
  </code></pre>
  
  <p>This returns a cryptic node.js error. I'm running node v0.4.11, I'm upgrading now to see if that fixes it.</p>
  
  <p><strong>EDIT</strong> Here's the error:</p>
  
  <pre><code>Assertion failed: (!io-&gt;watcher_.active), function Set, file ../src/node_io_watcher.cc, line 160.
  </code></pre>
  
  <p>Thanks,
  Matt</p>