title: "Error: write EPIPE" with Socket.io on node.js
body: <p><strong>I manually applied this patch and everything works now. Waiting on upstream to fix this</strong>
  <a href="https://github.com/LearnBoost/socket.io-client/pull/361/files" rel="nofollow">https://github.com/LearnBoost/socket.io-client/pull/361/files</a></p>
  
  <hr>
  
  <p>I'm just trying to follow the examples given and trying to get this to work.</p>
  
  <p>Mockserver.js:</p>
  
  <pre><code>var io = require('socket.io').listen(8000);
  
  io.sockets.on('connection', function(client) {
      console.log('+ new client');
      client.on('disconnect', function() {
          console.log('- lost a client');
      });
  });
  </code></pre>
  
  <p>Mockclient.js:</p>
  
  <pre><code>var io = require('socket.io-client');
  var socket = new io.connect('localhost', { port: 8000 });
  
  socket.on('connect', function() {
      console.log('connected');
  });
  
  socket.on('message', function(data) {
      console.log(data);
  });
  </code></pre>
  
  <p>I then run these pair with node Mockserver.js and node Mockclient.js on another terminal</p>
  
  <pre><code>   info  - socket.io started
     debug - client authorized
     info  - handshake authorized 14797776461130411158
     debug - setting request GET /socket.io/1/websocket/14797776461130411158
     debug - set heartbeat interval for client 14797776461130411158
     debug - client authorized for 
     debug - websocket writing 1::
  + new client
     debug - set close timeout for client 14797776461130411158
     ***************************** error occurs here ****************
     info  - socket error Error: write EPIPE
     at errnoException (net.js:632:11)
     at Object.afterWrite [as oncomplete] (net.js:470:18)
     ****************************************************************
     debug - setting request GET /socket.io/1/xhr-polling/14797776461130411158?t=1325912082073
     debug - setting poll timeout
     debug - discarding transport
     debug - cleared close timeout for client 14797776461130411158
     debug - cleared heartbeat interval for client 14797776461130411158
     debug - clearing poll timeout
     info  - transport end
     debug- set close timeout for client 14797776461130411158
     debug - cleared close timeout for client 14797776461130411158
  </code></pre>
  
  <p>at this point I stopped Mockclient.js</p>
  
  <pre><code>- lost a client
     debug - discarding transport
  </code></pre>
  
  <p>The only output for "node Mockclient.js" is</p>
  
  <pre><code>The "sys" module is now called "util". It should have a similar interface.
  </code></pre>
  
  <p>What's causing the socket exception? I'm probably missing something pretty obvious. Also, can somebody else try my code to see if the errors on their machine as well? The code inside socket.on('connect'... isn't triggering either. I don't exactly know why.</p>