Increase the maximum number of connections per QtWebKit host

Question:

How to increase the default limit for 6 hosts per host in QtWebKit?

Use Case:

I have several QtWebKit panels (QWebView) displayed by PySide. (PyQt will also work the same). Limiting the default connection of 6 connections per host quickly became an obstacle, as persistent HTTP connections (Comet) are used to transfer data from each of these web panels. A solution would be to increase this limit, but I cannot find an API for this.

+4
source share
1 answer

There is no API for this. It is hardcoded in qhttpnetworkconnection.cpp as follows

#ifdef Q_OS_SYMBIAN const int QHttpNetworkConnectionPrivate::defaultChannelCount = 3; #else const int QHttpNetworkConnectionPrivate::defaultChannelCount = 6; #endif 

You can change it and create Qt yourself, or you can make a quick and very dirty hack suggested by the special channel IRC # qt irc.freenode.net in the form of the following code.

 hackUrl.setUserName(QString::number(qrand())); 

Referring to special:

the username of the URL in the connection cache is used, so as long as the username is different, this limit will not apply

+6
source

Source: https://habr.com/ru/post/1338150/


All Articles