title: Node.js net: socket.write - Part of the string doesn't appear
body: <p>I'm using the net module. I do socket.write but only part of the string appears.</p>
  
  <pre><code>    var id = data.slice(2,3).toString('binary').charCodeAt(0);
      var msg = data.slice(3).toString('binary');
      gotMessage(id, msg);
  </code></pre>
  
  <p>This is where I obtain the message, it's msg.</p>
  
  <pre><code>var packet = ":" + nick + "!~" + nick + "@" + server.serverName + " PRIVMSG " + cname + " :" + msg);
  socket.write(packet + "\x0D\x0A", 'binary');
  console.log("Sent: " + packet);
  </code></pre>
  
  <p>console.log outputs the message without any problems, socket.write only outputs part of it, msg doesn't appear. It appears in the IRC client as: "Name:", but no message.</p>