سؤال

Question:

How can the default limit of 6 connections per host be increased in QtWebKit?

Use case:

I've multiple QtWebKit (QWebView) panes displayed by a PySide application. (PyQt would also work the same way.) The default connection limit of 6 connections per host quickly became an obstacle, since persistent HTTP connections (Comet) are used for data communication by each of those Web panes. The solution would be to increase this limit, but I can't find the API for this.

هل كانت مفيدة؟

المحلول

There's no API for this. It's hardcoded in qhttpnetworkconnection.cpp in the following way

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

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

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

Citing special:

the username part of the URL is used in the connection cache, so as long as the username is different, that limit won't apply

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top