[Development] [QIODevice]How to correctly treat/understand of the documentation?

Thiago Macieira thiago.macieira at intel.com
Tue Apr 22 18:10:45 CEST 2014


Em ter 22 abr 2014, às 19:34:48, Denis Shienkov escreveu:
> 1. or keep it as is, but then bytesWritten() will be "tell lies"

It's not lying. It's telling the user that the bytes were written from the 
QIODevice to the underlying device. That's the best we can do, since now those 
bytes are no longer under our control.

Think about it. How do we know that the bytes were actually sent? What happens 
if the cable is torn? Next, we'd have users asking for confirmation that the 
other side received the data, which we can't provide. And even if the other 
side did receive the data (we can tell with TCP), we can't confirm that the 
application received the data. And even if it did read the data, there's no 
telling whether it acted on the data.

So, no, we provide details about the data we control, at the level we control. 
QIODevice has a buffer and bytesWritten informs about bytes being written from 
that buffer.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list