Connection reuse
QNetworkAccessManager will automatically try to reuse opened HTTP connections. This is also the reason why we should use only one QNetworkAccessManager instance—two separate instances cannot coordinate reusing of their connections, which results in unnecessary network traffic!
HTTP/1.1 defines a connection being keep-alive by default. However, the HTTP server will usually terminate a connection after some predefined time (typically 1 second). Here, we can see the tension between clients and the infrastructure that we have already observing in the case of Nagle's algorithm – the server's interest is in decreasing resource usage and being responsive to the new clients, while the client's interest is in keeping the connection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access