title: Using QTcpSocket for continuous fast usage
body: <p>I need to implement a client that reads data at 300 Hz (300 samples per second). When working with C sockets, everything was ok accept for the fact that I need to run a continuous while loop to get the data from the server (which blocks the client from handling anything else).
  So, I've decided trying to move to QTcpsocket, in order to handle signals that are coming from other object to the client object. But when I connect the Qtcpsocket, and connect the signal for reading </p>
  
  <pre><code>connect(socket,&amp;QTcpSocket::readyRead, this, &amp;client::handleReadyRead, Qt::ConnectionType::QueuedConnection);
  </code></pre>
  
  <p>this is my handler - </p>
  
  <pre><code>QByteArray b = socket-&gt;read(12);
  int packetLength = (unsigned char)b[6] &lt;&lt; CHAR_BIT;
  packetLength |=  (unsigned char)b[7];
  b = socket-&gt;read(packetLength);
  </code></pre>
  
  <p>(I get a 12 byte long header for each packet)
  Now I get a very slow client - It handles about maybe 3 samples per second...I've checked to see how much <code>bytesavailable()</code> returns, and it looks like data is piling up in the sockets buffer.
  What am I doing wrong? I have to get a very fast client, but I'm not sure that the way I'm reading is optimal. 
  Is there a more efficient way to do it?</p>
  
  <p>Thank you</p>