title: Sending too much data over websocket?
body: <p>I think I'm having issues sending too much data over a socket.io connection. I'm subscribing to a RabbitMQ exchange and sending data messages to the client for graphing real-time:</p>
  
  <pre><code>q.subscribe({routingKeyInPayload:true},function (message) {
    socket.emit('message', {
      key: message._routingKey,
      //msg: decodeURIComponent(message.data),
      client: qName,
      ts: new Date()
    });
    console.log('broadcasting: ' + message._routingKey);
  });
  </code></pre>
  
  <p>You can see that "msg" is commented out. When I comment this out, I am able to send ~100-200 messages/second (~800/s peak). However, when the "msg" is included in the JSON data, I get the following error:</p>
  
  <pre><code>events.js:72
      throw er; // Unhandled 'error' event
  </code></pre>
  
  <p>I'm not sure what the error actually is or how to handle it. Any advice would be appreciated.</p>
  
  <p>EDIT: A typical message looks like (I've sanitized the userid's just in case):</p>
  
  <pre><code>{"key":"message.1","client":"7raQ6vpCO-PZ5ZTWQVD9","ts":"2013-09-12T22:19:06.677Z"}]}
  {"fromuserid": 62XXXX34, "deleted": 0, "messagetype": 1, "datetime": 1379024283000, "touserid": 12XXXX41, "message": "Bored lol, really bored lol", "id": 27963323859}
  </code></pre>