The QHttp2Configuration class controls HTTP/2 parameters and settings. 更多...
| 頭: |
#include <QHttp2Configuration>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Network)
target_link_libraries(mytarget PRIVATE Qt6::Network)
|
| qmake: |
QT += network
|
注意: 此類的所有函數 可重入 .
| QHttp2Configuration () | |
| QHttp2Configuration (const QHttp2Configuration & other ) | |
| QHttp2Configuration (QHttp2Configuration && other ) | |
| ~QHttp2Configuration () | |
| bool | huffmanCompressionEnabled () const |
| 無符號 int | maxFrameSize () const |
| bool | serverPushEnabled () const |
| 無符號 int | sessionReceiveWindowSize () const |
| void | setHuffmanCompressionEnabled (bool enable ) |
| bool | setMaxFrameSize (unsigned int size ) |
| void | setServerPushEnabled (bool enable ) |
| bool | setSessionReceiveWindowSize (unsigned int size ) |
| bool | setStreamReceiveWindowSize (unsigned int size ) |
| 無符號 int | streamReceiveWindowSize () const |
| void | swap (QHttp2Configuration & other ) |
| QHttp2Configuration & | operator= (QHttp2Configuration && other ) |
| QHttp2Configuration & | operator= (const QHttp2Configuration & other ) |
| bool | operator!= (const QHttp2Configuration & lhs , const QHttp2Configuration & rhs ) |
| bool | operator== (const QHttp2Configuration & lhs , const QHttp2Configuration & rhs ) |
QHttp2Configuration controls HTTP/2 parameters and settings that QNetworkAccessManager will use to send requests and process responses when the HTTP/2 protocol is enabled.
The HTTP/2 parameters that QHttp2Configuration currently supports include:
The QHttp2Configuration class also controls if the header compression algorithm (HPACK) is additionally using Huffman coding for string compression.
注意: The configuration must be set before the first request was sent to a given host (and thus an HTTP/2 session established).
注意: Details about flow control, server push and 'SETTINGS' can be found in RFC 7540 . Different modes and parameters of the HPACK compression algorithm are described in RFC 7541 .
另請參閱 QNetworkRequest::setHttp2Configuration (), QNetworkRequest::http2Configuration (),和 QNetworkAccessManager .
Default constructs a QHttp2Configuration object.
Such a configuration has the following values:
Copy-constructs this QHttp2Configuration.
[noexcept]
QHttp2Configuration::
QHttp2Configuration
(
QHttp2Configuration
&&
other
)
Move-constructs this QHttp2Configuration from other
[noexcept]
QHttp2Configuration::
~QHttp2Configuration
()
析構函數。
返迴
true
if the Huffman coding in HPACK is enabled.
另請參閱 setHuffmanCompressionEnabled .
Returns the maximum payload size that HTTP/2 frames can have. The default (initial) value is 16384 octets.
另請參閱 setMaxFrameSize ().
Returns true if server push was enabled.
注意: 默認情況下, QNetworkAccessManager disables server push via the 'SETTINGS' frame.
另請參閱 setServerPushEnabled .
Returns the window size for connection-level flow control. The default value QNetworkAccessManager will be using is 2147483647 octets.
另請參閱 setSessionReceiveWindowSize ().
若
enable
is
true
, HPACK compression will additionally compress string using the Huffman coding. Enabled by default.
注意: This parameter only affects 'HEADERS' frames that QNetworkAccessManager is sending.
另請參閱 huffmanCompressionEnabled .
Sets the maximum frame size that QNetworkAccessManager will advertise to the server when sending its initial SETTINGS frame.
注意: While this size is required to be within a range between 16384 and 16777215 inclusive, the actual payload size in frames that carry payload maybe be less than 16384.
返迴
true
當成功時,
false
否則。
另請參閱 maxFrameSize ().
若
enable
is
true
, a remote server can potentially use server push to send responses in advance.
另請參閱 serverPushEnabled .
Sets the window size for connection-level flow control. size cannot be 0 and must not exceed 2147483647 octets.
返迴
true
當成功時,
false
否則。
另請參閱 sessionReceiveWindowSize .
Sets the window size for stream-level flow control. size cannot be 0 and must not exceed 2147483647 octets.
返迴
true
當成功時,
false
否則。
另請參閱 streamReceiveWindowSize .
Returns the window size for stream-level flow control. The default value QNetworkAccessManager will be using is 214748364 octets (see RFC 7540 ).
另請參閱 setStreamReceiveWindowSize ().
[noexcept]
void
QHttp2Configuration::
swap
(
QHttp2Configuration
&
other
)
Swaps this configuration with other 。此操作很快且從不失敗。
[noexcept]
QHttp2Configuration
&QHttp2Configuration::
operator=
(
QHttp2Configuration
&&
other
)
移動賦值 other 到此 QHttp2Configuration .
Copy-assigns other 到此 QHttp2Configuration .
[noexcept]
bool
operator!=
(const
QHttp2Configuration
&
lhs
, const
QHttp2Configuration
&
rhs
)
返迴
true
if
lhs
and
rhs
do not have the same set of HTTP/2 parameters.
[noexcept]
bool
operator==
(const
QHttp2Configuration
&
lhs
, const
QHttp2Configuration
&
rhs
)
返迴
true
if
lhs
and
rhs
have the same set of HTTP/2 parameters.