title: Stop node.js program from command line
body: <p>I have a simple TCP server that listens on a port.</p>
  
  <pre><code>var net = require("net");
  
  var server = net.createServer(function(socket) {
      socket.end("Hello!\n");
  });
  
  server.listen(7777);
  </code></pre>
  
  <p>I start it with <code>node server.js</code> and then close it with Ctrl + Z on Mac. When I try to run it again with <code>node server.js</code> I get this error message:</p>
  
  <pre><code>node.js:201
          throw e; // process.nextTick error, or 'error' event on first tick
            ^
  Error: listen EADDRINUSE
  at errnoException (net.js:670:11)
  at Array.0 (net.js:771:26)
  at EventEmitter._tickCallback (node.js:192:41)
  </code></pre>
  
  <p>Am I closing the program the wrong way? How can I prevent this from happening?</p>