title: How to pass a QTcpSocket to a QRunnable in Qt 5.2
body: <p>I'm attempting to write a tcp server using Qt 5.2 in a scalable way by using QRunnable and QThreadPool instead of 1 thread per connection. </p>
  
  <p>The problem I'm encountering is that the socket created in the QRunnable::run has a status of connected when I create it and set it's socket descriptor , but calling readAll() in response to the readyRead signal yields an empty buffer, even though I know I sent some data.</p>
  
  <p>The two ways I've tried to pass the socket from the main thread to the QRunnable are:</p>
  
  <p>1)Get the QTcpSocket from QTcpServer::nextPendingConnection and pass the socket descriptor to the QRunnable.</p>
  
  <p>2)Override the QTcpServer::incomingConnection and get the socket descriptor from there and pass it to the QRunnable.</p>
  
  <p>Both give the same result, the sockets readyread signal is received but readAll returns an empty buffer.</p>
  
  <p>Any help would be very much appreciated.</p>