Hi!

How I can read and write information to/from socket line by line?

Now I'm doing this:
Qt Code:
  1. tcpSocket.waitForReadyRead();
  2. QByteArray request( tcpSocket.readAll() );
To copy to clipboard, switch view to plain text mode 

But this is incorrect, because program don't wait two "\r\n" and after first write goes next.

PS I'm writing a small HTTP server.

And also one question: how I can get speed of file downloading? And how I can set it? Or how I can abor connection from UI?