title: Node.js is unable to handle multiple tcp messages
body: <p>Here is a simple TCP-Server stress test. As long as we send only one message per client everything works as expected. But when two messages per client are send,
  the server suddenly stops without an exception or error.
  So is this a bug or a feature?</p>
  
  <pre><code>var net = require("net");
  var async = require("async");
  var cluster = require("cluster");
  
  // `ulimit -n` tells us that we can open max. 1024 files per process.
  //  Creating a socket means opening a file so we are limited.
  var CLIENTS = 1000;
  
  // Here is the weird part:
  // - sending one message per client works fine
  // - sending multiple message per client sucks
  var MESSAGES = 2;
  
  var TOTAL = CLIENTS * MESSAGES;
  var PORT = 1234;
  var HOST = "127.0.0.1";
  
  if (cluster.isMaster) {
    var count = 0;
    var start = new Date;
  
    var server = net.createServer(function(socket) {
      socket.on("data", function(data) {
        var t;
        count++;
        console.log("server received " + count + " messages");
        socket.write(data, function(err) { if (err) console.error(err); });
        if (count === TOTAL) {
          t = (new Date) - start;
          console.log("server received and sent " + count + " messages within " + t + "ms");
        }
      });
    });
  
    server.listen(PORT, HOST, function() { cluster.fork(); });
  
  } else {
  
    var run = function(i) {
      var c = net.connect({ port: PORT, host: HOST }, function() {
        var tasks = (function() {
          var results = [];
          for (var x = 1; x &lt;= MESSAGES; ++x) {
            results.push((function(x) {
              return function(next) { c.write("Hello server!", next); };
            })(x));
          }
          return results;
        })();
  
        async.series(tasks, function(err) {
          if (err) { console.error(err); }
        });
  
      });
    };
    for (var i = 1; i &lt;= CLIENTS; ++i) { run(i); }
  }
  </code></pre>
  
  <p>Tested on Linux 3.11, Node.js 0.10.21</p>