[PyQt] QNetworkAccessManager and HTTP persistent connection

iMath 2281570025 at qq.com
Sat Nov 23 13:36:38 GMT 2013


HTTP 1.1 supports persistent connection by default, so I want to send my a second http request using the same connection that was setup when the first HTTP request was made. how can this be achieved through Qt?

If I simply make the second request after the first one finished like the following
manager = QNetworkAccessManager(self) manager.finished[QNetworkReply].connect(self.replyFinished) manager.get(QNetworkRequest(QUrl("http://qt.nokia.com"))) 
it seems a new TCP connection to the server will be initiated (I have checked with a network sniffer) The experiment also says: If the reply is deleteLater() or abort() within finished() signal, the connection will be closed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20131123/489ee744/attachment.html>


More information about the PyQt mailing list