title: Can't collect tcp data to vector openframworks
body: <p>I am trying to fill up a vector char with data from a pointer via ofxTCPClient.</p>
  
  <p>The pointer tmpData is receiving the data, but I get this error if I try to push the data in to the vector.</p>
  
  <p>Even if I try to fill up the vector with a char "manually" like this:
      tcpMainData.push_back('a');</p>
  
  <p>do I get an error:</p>
  
  <pre><code>libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
  (lldb) 
  </code></pre>
  
  <p>This is my program:</p>
  
  <pre><code>#include "ofApp.h"
  
  using namespace std;
  
  vector&lt;char&gt; tcpMainData;
  
  //This is a temporary size variabel, until a function is made.
  int tmpDataSize = 100;
  char tmpData;
  
  
  //--------------------------------------------------------------
  void ofApp::setup(){
  
  }
  
  //--------------------------------------------------------------
  void ofApp::update(){
  
      //Listen on the port for tcp data if we are connected to the server
      if (!TCPClient.isConnected()) {
          state = OFFLINE;
      }else if (TCPClient.isConnected() &amp;&amp; state != RECEIVING) {
                  state = LISTENING;
      }
  
      //TCP package received
      if((int)TCPClient.receiveRawBytes((char *) &amp;tcpMainData, sizeOfTcpChunk) &gt; 1 &amp;&amp; state == LISTENING) {
  
          state = RECEIVING;
      }
  
      //Filling up vector with tcp data
      if (state == RECEIVING) {
  
          for (int i = 0; i &lt; tmpDataSize; i++) {
              TCPClient.receiveRawBytes((char *) &amp;tmpData, sizeOfTcpChunk);
  
              tcpMainData.push_back(tmpData);
          }
  
          state = LISTENING;
      }
  }
  
  //--------------------------------------------------------------
  void ofApp::draw(){
  
      if (state == OFFLINE) {
          ofDrawBitmapString("Press C to connect", 50, 100);
      }
  }
  
  //--------------------------------------------------------------
  void ofApp::keyPressed(int key){
  
      if (key == 'c') {
          TCPClient.setup("127.0.0.1", TCPPort);
      }
  }
  </code></pre>
  
  <p>Heres my header if it's relevant:</p>
  
  <pre><code>...
  
  //TCP CONF
  ofxTCPClient TCPClient;
  int TCPPort = 50014;
  
  int sizeOfTcpChunk = 4;             //Size of TCP packages (Chunks)
  
  //Program state
  enum clientState {
      OFFLINE,
      LISTENING,
      RECEIVING,
  };
  
  clientState state = LISTENING;
  </code></pre>