PySide6.QtHttpServer.QHttpServerConfiguration¶
- class QHttpServerConfiguration¶
The
QHttpServerConfigurationclass controls server parameters.Added in version 6.9.
Synopsis¶
Methods¶
def
__init__()def
__ne__()def
__eq__()def
swap()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
Default constructs a
QHttpServerConfigurationobject.Such a configuration has the following values:
Rate limit is disabled
- __init__(other)
- Parameters:
other –
QHttpServerConfiguration
Copy-constructs this
QHttpServerConfiguration.- keepAliveTimeout()¶
- Return type:
std::chrono::seconds
Returns the keep-alive timeout used by
QHttpServer.See also
- __ne__(rhs)¶
- Parameters:
rhs –
QHttpServerConfiguration- Return type:
bool
Returns
trueiflhsandrhsdo not have the same set of configuration parameters.- __eq__(rhs)¶
- Parameters:
rhs –
QHttpServerConfiguration- Return type:
bool
Returns
trueiflhsandrhshave the same set of configuration parameters.- rateLimitPerSecond()¶
- Return type:
int
Returns maximum number of incoming requests per second per IP accepted by the server.
See also
- setKeepAliveTimeout(timeout)¶
- Parameters:
timeout –
std::chrono::seconds
Sets
timeoutas keep-alive timeout forQHttpServer.The keep-alive timeout determines how long an idle connection is kept open before being closed. By default, the timeout is set to 15 seconds.
See also
- setRateLimitPerSecond(maxRequests)¶
- Parameters:
maxRequests – int
Sets
maxRequestsas the maximum number of incoming requests per second per IP that will be accepted byQHttpServer. If the limit is exceeded,QHttpServerwill respond withTooManyRequests.See also
- swap(other)¶
- Parameters:
other –
QHttpServerConfiguration
Swaps this configuration with
other. This operation is very fast and never fails.