Hello Jocelyn, This really helps me to understand the connection handling in Qtwebkit, thanks a lot.
All the best! > -----邮件原件----- > 发件人: Jocelyn Turcotte [mailto:[email protected]] > 发送时间: 2011年11月29日 20:26 > 收件人: ext 陈敏华 > 抄送: [email protected] > 主题: Re: [webkit-qt] about concurrent http connection restriction > > Hello, > comments below. > > On Tue, 29 Nov 2011 14:21:27 +0800 > ext 陈敏华 <[email protected]> wrote: > > > Hello everyone, > > > > I just want to figure out how Qtwebkit handle for concurrent http connections, > and I have found some relevant code from file "ResourceRequestQt.cpp. The code > is as follows, but I can't understand it well. > > > > // Currently Qt allows three connections per host on symbian and six > > // for everyone else. The limit can be found in qhttpnetworkconnection.cpp. > > // To achieve the best result we want WebKit to schedule the jobs so we > > // are using the limit as found in Qt. To allow Qt to fill its queue > > // and prepare jobs we will schedule two more downloads. > > // Per TCP connection there is 1 current processed, 3 possibly pipelined > > // and 2 ready to re-fill the pipeline. > > unsigned initializeMaximumHTTPConnectionCountPerHost() > > { > > #ifdef Q_OS_SYMBIAN > > return 3 * (1 + 3 + 2); > > #else > > return 6 * (1 + 3 + 2); > > #endif > > } > > > > My question is as follows: > > 1. Does the maximum number of concurrent http connection for each host equal > to 36? > The name of this WebCore methods can be misleading, the roles of each is that > WebCore sends requests to Qt, and Qt establish connections to send those > requests. So in this case, there would be maximum 36 requests distributed on > 6 parallel connections to each host. If more requests are pending, WebCore will > keep them for itself instead of throwing all of them at Qt. > > > 2. Is there any restriction for overall number of http connection that can > be hold by Qtwebkit at any time? > I didn't verify but I think we don't, though the OS might have some limits of > its own. > > > 3. Http 1.1 has a concept called "persistent connection", does QtWebkit > support this feature? If so, what's the relationship between the number of > http request& reponse that have been made and the number of tcp sockets > established? > The 6 parallel connections per host held by QNetworkAccessManager are > persistent connections, when a pending request is fed to Qt, any already opened > connection will be used if available instead of establishing a new one. > > > Does anybody can help me solve this problem? > > Thank you very much. > Hope this helps. > > Jocelyn _______________________________________________ webkit-qt mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt
