Qt sends the data directly to the tcp implementation on your system. It is responsible for control flow. If you fill the write buffer in your system, the socket will stop receiving data (thus it is important to check whether all data has actually been written). Therefore you should not worry too much about it. If you really want, append all data to be written to some internal buffer, control its size and connect to bytesWritten() signal to put more data into the socket. Then you'll have a sort of internal write buffer that you have total control over. You can either reject accepting more data or (if possible in your particular case) sleep on a wait condition (the latter is similar to waitForBytesWritten).





Reply With Quote

Bookmarks