[Interest] Stream uploading with QNetworkAccessManager

Thiago Macieira thiago.macieira at intel.com
Mon Jul 16 14:19:45 CEST 2012


On segunda-feira, 16 de julho de 2012 19.58.06, Weng Xuetian wrote:
> Hi Qt world,
> I need to upload some data via http through QLocalSocket until QLocalSocket
> closed, thus I'm trying to use QNetworkAccessManager put() and pass the
> socket pointer to it, but QNetworkAccessMaanger seems only send some inital
> data read from the socket and finished. Should I use QNetworkAccessManager
> or I need to use something else?

In order to stream-upload, QNetworkAccessManager requires a few guarantees 
from you and the receiving side.

You need to:
 - provide the exact size of the upload before it starts
 - set QNetworkRequest::DoNotBufferUploadDataAttribute in the request

If you can't do that, QNAM will need to buffer the entire content before it 
starts sending it.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120716/df593017/attachment.sig>


More information about the Interest mailing list