[Qt-interest] Subclass QNetworkRequest
Thiago Macieira
thiago at kde.org
Tue Feb 23 08:27:35 CET 2010
Em Segunda-feira 22. Fevereiro 2010, às 23.20.14, Jason Wood escreveu:
> Hi,
>
> Is it possible to subclass QNetworkRequest to throttle outgoing data?
No.
It's possible to subclass QNetworkRequest, but it won't do you any good. It
doesn't contain any data.
Did you mean subclassing QNetworkReply?
> 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.
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.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100223/7c270fec/attachment.bin
More information about the Qt-interest-old
mailing list