title: Read from QTcpSocket using QDataStream
body: <p>I need to send binary data through a <code>QTcpSocket</code>. I was thinking about using <code>QDataStream</code>, but I've encountered a problem - it silently fails if no data has arrived at the time I try to read.</p>
  
  <p>For example if I have this code:</p>
  
  <pre><code>QString str;
  stream &gt;&gt; str;
  </code></pre>
  
  <p>It will fail silently if no data is currently there in the socket. Is there a way to tell it to block instead?</p>