QNetworkAccessManager - how to enable more than 6 connections
Hello, I'm trying to cooperate with very busy web server. I send get and post requests to it and wait few seconds for response. If there is no response I'm doing what I would do in a web browser - send request again. I think that this is an equivalent to refreshing page. But there is a problem. In HttpAnalyzerStdV7 I can see http requests and responds. It looks like QNetworkAccessManager let me sends only 6 requests at once and only when server responds after about 120 seconds with 504 - http timeout code I can send a new one. How can I abandon old request? I thought that deleting QNetworkReply would be enough but it doesn't work. Any suggestions?
Re: QNetworkAccessManager - how to enable more than 6 connections
Quote:
Originally Posted by
code_err
It looks like QNetworkAccessManager let me sends only 6 requests at once and only when server responds after about 120 seconds with 504 - http timeout code I can send a new one.
Indeed, as stated in the documentation for QNetworkAccessManager:
Currently, for the HTTP protocol on desktop platforms, 6 requests are executed in parallel for one host/port combination.
Quote:
Originally Posted by
code_err
How can I abandon old request? I thought that deleting QNetworkReply would be enough but it doesn't work. Any suggestions?
You could try QNetworkReply::abort(), but I suspect it will not improve over the destructor; both apparently close the network connection. Does your HttpAnalyzerStdV7 show the connections being closed?
Re: QNetworkAccessManager - how to enable more than 6 connections
close and abort do different things, see the documentation for QNetworkReply::close().
Cheers,
_
Re: QNetworkAccessManager - how to enable more than 6 connections
Thank You. I didn't see abort and close. It can be useful. HttpAnalyzerStdV7 shows only requests and responds. After 120s server responds with 504 code and then connection is shown by HttpAnalyzerStdV7 as closed.