QHttp2Configuration Class
QHttp2Configuration クラスは、HTTP/2 のパラメータや設定を制御します。詳細...
| ヘッダー: | #include <QHttp2Configuration> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Network) target_link_libraries(mytarget PRIVATE Qt6::Network) |
| qmake: | QT += network |
- 継承されたメンバーを含む、すべてのメンバーの一覧
- QHttp2Configuration は、ネットワークプログラミング APIおよび暗黙的に共有されるクラスの一部です。
注:このクラスのすべての関数は再入可能です。
パブリック関数
| QHttp2Configuration() | |
| QHttp2Configuration(const QHttp2Configuration &other) | |
| QHttp2Configuration(QHttp2Configuration &&other) | |
| ~QHttp2Configuration() | |
| bool | huffmanCompressionEnabled() const |
(since 6.9) unsigned int | maxConcurrentStreams() const |
| unsigned int | maxFrameSize() const |
| bool | serverPushEnabled() const |
| unsigned int | sessionReceiveWindowSize() const |
| void | setHuffmanCompressionEnabled(bool enable) |
(since 6.9) void | setMaxConcurrentStreams(unsigned int value) |
| bool | setMaxFrameSize(unsigned int size) |
| void | setServerPushEnabled(bool enable) |
| bool | setSessionReceiveWindowSize(unsigned int size) |
| bool | setStreamReceiveWindowSize(unsigned int size) |
| unsigned 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 は、HTTP/2 プロトコルが有効になっている場合に、QNetworkAccessManager がリクエストの送信やレスポンスの処理に使用する HTTP/2 パラメータおよび設定を制御します。
QHttp2Configuration が現在サポートしている HTTP/2 パラメータには、以下のものがあります。
- 接続レベルでのフロー制御のためのセッションウィンドウサイズ。必要に応じて、識別子 0 のストリーム上で「WINDOW_UPDATE」フレームとしてリモートピアに送信されます。
- ストリームレベルのフロー制御のためのストリーム受信ウィンドウサイズ。初期の SETTINGS フレーム内で「SETTINGS_INITIAL_WINDOW_SIZE」パラメータとして送信され、必要に応じて、QNetworkAccessManager が開くストリーム上で「WINDOW_UPDATE」フレームが送信されます。
- 最大フレームサイズ。このパラメータは、リモートピアから送信されるフレームが持つことができる最大ペイロードを制限します。QNetworkAccessManager によって、初期の「SETTINGS」フレーム内の「SETTINGS_MAX_FRAME_SIZE」パラメータとして送信されます。
- サーバープッシュ。サーバープッシュを有効または無効にすることができます。初期の「SETTINGS」フレーム内で「SETTINGS_ENABLE_PUSH」パラメータとして送信されます。
QHttp2Configuration クラスは、ヘッダー圧縮アルゴリズム(HPACK)が文字列圧縮のためにハフマン符号化を追加で使用するかどうかも制御します。
注: 設定は 、特定のホストへの最初のリクエストが送信される前(つまり、HTTP/2 セッションが確立される前)に行う必要があります。
関連項目: QNetworkRequest::setHttp2Configuration()、QNetworkRequest::http2Configuration()、およびQNetworkAccessManager 。
メンバ関数のドキュメント
QHttp2Configuration::QHttp2Configuration()
default は QHttp2Configuration オブジェクトを生成します。
この設定には、以下の値が設定されています:
- サーバープッシュは無効になっています
- ハフマン文字列圧縮が有効
- 接続レベルのフロー制御のウィンドウサイズは 65535 オクテット
- ストリームレベルのフロー制御のウィンドウサイズは 65535 オクテット
- フレームサイズは 16384 オクテット
- 受け入れ可能なヘッダーリストの最大サイズは 262144 オクテット (256 KiB) です
QHttp2Configuration::QHttp2Configuration(const QHttp2Configuration &other)
この QHttp2Configuration をコピーして作成します。
[noexcept] QHttp2Configuration::QHttp2Configuration(QHttp2Configuration &&other)
この QHttp2Configuration をother
[noexcept] QHttp2Configuration::~QHttp2Configuration()
デストラクタ。
bool QHttp2Configuration::huffmanCompressionEnabled() const
HPACKのハフマン符号化が有効になっている場合、true を返します。
setHuffmanCompressionEnabledも参照してください 。
[since 6.9] unsigned int QHttp2Configuration::maxConcurrentStreams() const
同時実行可能なストリームの最大数を返します。
この関数は Qt 6.9 で導入されました。
setMaxConcurrentStreams()も参照してください 。
unsigned int QHttp2Configuration::maxFrameSize() const
HTTP/2フレームが持つことができる最大ペイロードサイズを返します。デフォルト(初期)値は16384オクテットです。
setMaxFrameSize()も参照してください 。
bool QHttp2Configuration::serverPushEnabled() const
サーバープッシュが有効になっている場合、trueを返します。
注: デフォルトでは 、QNetworkAccessManager は「SETTINGS」フレーム経由のサーバープッシュを無効にします。
関連項目: setServerPushEnabled 。
unsigned int QHttp2Configuration::sessionReceiveWindowSize() const
接続レベルのフロー制御用のウィンドウサイズを返します。QNetworkAccessManager が使用するデフォルト値は、2147483647オクテットです。
setSessionReceiveWindowSize()も参照してください 。
void QHttp2Configuration::setHuffmanCompressionEnabled(bool enable)
enable がtrue に設定されている場合、HPACK圧縮ではハフマン符号化を用いて文字列をさらに圧縮します。デフォルトで有効になっています。
注:この パラメータは 、QNetworkAccessManager が送信する「HEADERS」フレームにのみ影響します。
「huffmanCompressionEnabled」も参照してください 。
[since 6.9] void QHttp2Configuration::setMaxConcurrentStreams(unsigned int value)
value を、SETTINGS フレームを送信する際にピアに対して通知される同時ストリームの最大数として設定します。
この関数は Qt 6.9 で導入されました。
maxConcurrentStreams()も参照してください 。
bool QHttp2Configuration::setMaxFrameSize(unsigned int size)
QNetworkAccessManager が初期のSETTINGSフレームを送信する際に、サーバーに対して通知する最大フレームサイズを設定します。
注: このsize は16384から16777215の範囲内(両端を含む)である必要がありますが、 ペイロードを運ぶフレームの実際のペイロードサイズは16384未満の場合があります。
成功した場合はtrue を返し、それ以外の場合はfalse を返します。
maxFrameSize()も参照してください 。
void QHttp2Configuration::setServerPushEnabled(bool enable)
enable がtrue である場合、リモートサーバーはサーバープッシュを利用して、事前にレスポンスを送信できる可能性があります。
「serverPushEnabled」も参照してください 。
bool QHttp2Configuration::setSessionReceiveWindowSize(unsigned int size)
接続レベルのフロー制御のウィンドウサイズを設定します。size は0にすることはできず、2147483647オクテットを超えてはなりません。
成功した場合は `true ` を返し、それ以外の場合は `false ` を返します。
sessionReceiveWindowSizeも参照してください 。
bool QHttp2Configuration::setStreamReceiveWindowSize(unsigned int size)
ストリームレベルのフロー制御のウィンドウサイズを設定します。size は0に設定できず、2147483647オクテットを超えてはなりません。
成功した場合は `true ` を返し、それ以外の場合は `false ` を返します。
streamReceiveWindowSizeも参照してください 。
unsigned int QHttp2Configuration::streamReceiveWindowSize() const
ストリームレベルのフロー制御用のウィンドウサイズを返します。QNetworkAccessManager が使用するデフォルト値は、214748364オクテットです(RFC 7540を参照)。
setStreamReceiveWindowSize()も参照してください 。
[noexcept] void QHttp2Configuration::swap(QHttp2Configuration &other)
この設定をother と入れ替えます。この操作は非常に高速で、失敗することはありません。
[noexcept] QHttp2Configuration &QHttp2Configuration::operator=(QHttp2Configuration &&other)
other をこのQHttp2Configuration に移動・割り当てます。
QHttp2Configuration &QHttp2Configuration::operator=(const QHttp2Configuration &other)
other をこのQHttp2Configuration にコピー割り当てします。
関連する非会員
[noexcept] bool operator!=(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs)
lhs とrhs の HTTP/2 パラメータが一致しない場合、true を返します。
[noexcept] bool operator==(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs)
lhs とrhs が同じ HTTP/2 パラメータのセットを持つ場合、true を返します。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.