[Qt-interest] Subclass QNetworkRequest
Markus Goetz
Markus.Goetz at nokia.com
Tue Feb 23 08:39:38 CET 2010
ext Thiago Macieira wrote:
>> It
>> doesn't seem to implement QIODevice so I'm not exactly sure how I could do
>> it, does anyone have any ideas? I was originally using a throttled
>> QIODevice as the data in the QNetworkAccessManager::post() method which is
>> OK in Windows but OSX seems to have a much larger buffer size and so
>> buffering to low speed (~5kB/s) causes the connection to timeout because
>> the data is not sent until the internal buffer is full. Please correct me
>> if I'm wrong but that does seem to be the case from my testing.
>>
Should not happen. The OS should send as soon as it has ~MTU bytes.
> Your approach is correct.
>
> Your QIODevice must emit readyRead() and supply with enough data to keep the
> transfer rate limited. There should be no buffering effects on sending data, so
> if you have a testcase showing it failing on Mac, we'll be interested.
>
>
Please note that you must somehow tell the full size of the QIODevice to
QNAM, e.g. by letting the QIODevice be isSequential()==false and
returning a proper size().
Markus
More information about the Qt-interest-old
mailing list