title: "Uncaught exception: out of memory" in TCP Client for Firefox OS
body: <p>I'm trying to send some data over TCP connection from my TCP client for Firefox OS. Initially I started with filling <code>loginBytes</code> with the data which should help me to login to the service specified by <code>ip</code> and <code>port</code> (array's size is 28 bytes), now I'm trying to send an empty array. In any case the outcome is the same: in console log of Firefox Web IDE I can see the following message: <code>uncaught exception: out of memory</code>. And among the messages I tried to use for debugging only <code>"Started sending data"</code> is printed. So I come to a conclusion that the failure takes place during the execution of the <code>send</code> command. But what can be wrong with it?</p>
  
  <pre class="lang-js prettyprint-override"><code>(function() {
      var sendButton = document.querySelector('#send');
      var notes = document.querySelector('#notes');
      var options = {binaryType: 'arraybuffer'};
      var socket = navigator.mozTCPSocket.open(ip, port, options);
  
      sendButton.addEventListener('click', function() {                           
          var loginBytes = [];
          var Int8View = new Uint8Array(loginBytes);      
          socket.ondata = function(event) {
              console.log("Started receiving data");
              console.log(event.data);
              console.log("Received successfully");
          }
          socket.onerror = function(event) {
              console.log("Everything is bad");
          }
          console.log("Started sending data");
          socket.send(Int8View);
          console.log("Sent successfully");                                   
      });
  })();
  </code></pre>