Hi.
I'm looking at the code of qt example "the fortune client", and they use the code


Qt Code:
  1. QString nextFortune;
  2. in >> nextFortune;
To copy to clipboard, switch view to plain text mode 
to read a fortune from the socket, but what if they had got more data than that?
If the server sent two fortunes and the fortunes were broken down into little pieces and then received in some order, would the socket re-arrange the data so I get first one fortune and then the other one? I guess I'm a little clueless on network programming. I would assume that the networkstack is clever enough to put the pieces together in the right order before I read it from my Qt program, is it not?

But assuming that I only want to read the number of bytes that are given in the variable blocksize in the fortune client, how would I do that, even if there are more data waiting to be read? Assuming the fortune is stored as a Qstring (16 bit per char isn'it?) and then I really want to read data and put it back as a QString.