QHttpServerConfiguration Class
QHttpServerConfiguration 类控制服务器参数。更多
头文件: | #include <QHttpServerConfiguration> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS HttpServer) target_link_libraries(mytarget PRIVATE Qt6::HttpServer) |
qmake: | QT += httpserver |
自 | Qt 6.9 |
公共函数
QHttpServerConfiguration() | |
QHttpServerConfiguration(const QHttpServerConfiguration &other) | |
QHttpServerConfiguration(QHttpServerConfiguration &&other) | |
~QHttpServerConfiguration() | |
quint32 | rateLimitPerSecond() const |
void | setRateLimitPerSecond(quint32 maxRequests) |
void | swap(QHttpServerConfiguration &other) |
QHttpServerConfiguration & | operator=(QHttpServerConfiguration &&other) |
QHttpServerConfiguration & | operator=(const QHttpServerConfiguration &other) |
相关非成员
bool | operator!=(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs) |
bool | operator==(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs) |
成员函数文档
QHttpServerConfiguration::QHttpServerConfiguration()
Default 构造一个 QHttpServerConfiguration 对象。
这种配置具有以下值:
- 禁用速率限制
QHttpServerConfiguration::QHttpServerConfiguration(const QHttpServerConfiguration &other)
复制-构建此 QHttpServerConfiguration。
[noexcept]
QHttpServerConfiguration::QHttpServerConfiguration(QHttpServerConfiguration &&other)
Move-construct this QHttpServerConfiguration fromother
[noexcept]
QHttpServerConfiguration::~QHttpServerConfiguration()
毁灭者
quint32 QHttpServerConfiguration::rateLimitPerSecond() const
返回服务器每个 IP 每秒接受的最大传入请求数。
另请参阅 setRateLimitPerSecond()。
void QHttpServerConfiguration::setRateLimitPerSecond(quint32 maxRequests)
将maxRequests 设置为QHttpServer 每 IP 每秒可接受的最大传入请求数。如果超过限制,QHttpServer 将以QHttpServerResponder::StatusCode::TooManyRequests 回应。
另请参阅 rateLimitPerSecond() 和QHttpServerResponder::StatusCode 。
[noexcept]
void QHttpServerConfiguration::swap(QHttpServerConfiguration &other)
将此配置与other 互换。该操作速度非常快,从未出现过故障。
[noexcept]
QHttpServerConfiguration &QHttpServerConfiguration::operator=(QHttpServerConfiguration &&other)
移动--将other 分配到此QHttpServerConfiguration 。
QHttpServerConfiguration &QHttpServerConfiguration::operator=(const QHttpServerConfiguration &other)
复制分配other 至QHttpServerConfiguration 。
相关非会员
[noexcept]
bool operator!=(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs)
如果lhs 和rhs 的配置参数集不同,则返回true
。
[noexcept]
bool operator==(const QHttpServerConfiguration &lhs, const QHttpServerConfiguration &rhs)
如果lhs 和rhs 具有相同的配置参数集,则返回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.