[Qt-interest] QNetworkAccessManager with multi connections ?

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Tue Oct 19 11:05:17 CEST 2010


>> If your requirement is to process a reply first before sending out the
>> next req, then you can simply dispatch the next request only if the
>> processing of the previous req succeeded.
>
> So which architecture is better of design ?
>
> Single QNAM with multi requests or multi QThread based class , each
> contains a QNAM inside ?

I would prefer a single QNAM sending out multiple requests.
>
> And any example of codes for blocking mode connections ?

No example handy right now. QNAM itself does not provide any blocking IO mode.
Though you can simulate putting requests synchronously.

A crude ex:

QEventLoop qel;
...
...
qnam.get(req1);
qel.exec();

// do qel.exit() in the slot processing the reply for req1

//put next req
qnam.get(req2);
qel.exec();

... and so on...

HTH,
-mandeep

>
>
> - --
> Best Regards,
> Aaron Lewis - PGP: 0xDFE6C29E
> Key Server: http://keyserver.veridis.com
> Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
>
> No HTML shits , thanks.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.16 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQIcBAEBAgAGBQJMvVZlAAoJECSSp9Df5sKeILgP/3d99y80yU3sEwRUPGRRA3lp
> B2p+h4bHjEp6Ps5RV8j6QPf893FYhD/BVHJTFKclUX5/IGWmvMK8CaVcn1dlXUjA
> 1ucZHeBQ7+DhvQNbhkSye38b8YiKGhxNthJlHIf1TmxdJ3yNYu/MoY03y9jAUDiH
> ymuvyRp1dv9nnS6joUu0v2gp7Kly+gscfnYnld8oBGt4vZqrygApQK2X6eBRTV4v
> jpfooKUBeWD8N7D3cY2RwDFd/Tt+Fw92/SQdC5vboD3nAKpjm8mUGAmsx4l6uJIJ
> X4nz4gN0K87yUoZBY84nYPdaVeuUFAF9uREU3oHLFm+8juQb9Wr5HV4ggp18AMgi
> DAnzC+lWGH9TGzfe2W4xfxBuz6gg497kkru+DXL/6RR9PRclXyT17HUQ6r5pymI3
> JhPQl5uGoohV8maV8tI5OCKcbOB3QCVZQP65uOp8IzeBcxlnzu3MMexEpnmXBWp7
> K6sg9Tz+PFq0/4EOVRqnEGzOxg86a27WJZin5cwRUXZk70yAyR5XTqE92qsQOpWG
> x7t7wbG9YPOa8Abk1Z0rAB4BAhU5hDEnba1iTGLGEaKLjFhYj3wfYY545kNqnz1w
> T0W17RhgDYaX8ji+c5kPWyJdbWmXr9JBc8AoXNAihwOey2nxrGtQopFlKDEv868/
> RD9HAjEJSuDKnQrdX/dR
> =6nzl
> -----END PGP SIGNATURE-----
>



More information about the Qt-interest-old mailing list