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 はNetwork Programming APIおよびImplicitly Shared Classes に含まれています。
注意:このクラスの関数はすべてリエントラントです。
パブリック関数
QHttp2Configuration() | |
QHttp2Configuration(const QHttp2Configuration &other) | |
QHttp2Configuration(QHttp2Configuration &&other) | |
~QHttp2Configuration() | |
bool | huffmanCompressionEnabled() const |
unsigned int | maxFrameSize() const |
bool | serverPushEnabled() const |
unsigned 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) |
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オクテット
QHttp2Configuration::QHttp2Configuration(const QHttp2Configuration &other)
この QHttp2Configuration をコピーします。
[noexcept]
QHttp2Configuration::QHttp2Configuration(QHttp2Configuration &&other)
からこの QHttp2Configuration を移動します。other
[noexcept]
QHttp2Configuration::~QHttp2Configuration()
破壊者。
bool QHttp2Configuration::huffmanCompressionEnabled() const
HPACK のハフマン符号化が有効な場合はtrue
を返す。
setHuffmanCompressionEnabledも参照のこと 。
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も参照のこと 。
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)
QHttp2ConfigurationMove-assignother 。
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
を返す。
© 2025 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.