I'm learning a bit about TCP and QT by writing a server and client.
I have noticed that the examples (Fortune Cookie server and client) use QDataStream to send and receive, and place a quint16 before the message indicating the expected size.
I am curious why this approach was used. I have not seen any other servers I have looked at do anything similar (they seem to simply send the data without the quint16 at the start).
I've been able to make it work both ways (with and without) but wonder which I should use?
Is there some QT specific reason to use the quint16 method?
Thanks in advance
Bookmarks