The QMqttConnectionProperties class represents configuration options a QMqttClient can pass to the server when invoking QMqttClient::connectToHost (). 更多...
头: | #include <QMqttConnectionProperties> |
qmake: | QT += mqtt |
Since: | Qt 5.12 |
继承者: |
该类在 Qt 5.12 引入。
QByteArray | authenticationData () const |
QString | authenticationMethod () const |
quint32 | maximumPacketSize () const |
quint16 | maximumReceive () const |
quint16 | maximumTopicAlias () const |
bool | requestProblemInformation () const |
bool | requestResponseInformation () const |
quint32 | sessionExpiryInterval () const |
void | setAuthenticationData (const QByteArray & authData ) |
void | setAuthenticationMethod (const QString & authMethod ) |
void | setMaximumPacketSize (quint32 packetSize ) |
void | setMaximumReceive (quint16 maximumReceive ) |
void | setMaximumTopicAlias (quint16 alias ) |
void | setRequestProblemInformation (bool problem ) |
void | setRequestResponseInformation (bool response ) |
void | setSessionExpiryInterval (quint32 expiry ) |
void | setUserProperties (const QMqttUserProperties & properties ) |
QMqttUserProperties | userProperties () const |
注意: Connection properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See QMqttClient::ProtocolVersion 了解更多信息。
Returns the authentication data.
另请参阅 setAuthenticationData ().
Returns the authentication method.
另请参阅 setAuthenticationMethod ().
Returns the maximum packet size the client can receive.
另请参阅 setMaximumPacketSize ().
Returns the maximum amount of QoS 1 and QoS 2 publications that the client (when obtained from QMqttClient::connectionProperties ()) or the server (when obtained from QMqttClient::serverConnectionProperties ()) is willing to process concurrently for this session.
另请参阅 setMaximumReceive ().
Returns the maximum topic alias ID the client can use.
另请参阅 setMaximumTopicAlias ().
Returns whether the client should receive problem information.
另请参阅 setRequestProblemInformation ().
Returns whether the client should receive response information.
另请参阅 setRequestResponseInformation ().
Returns the session expiry interval.
另请参阅 setSessionExpiryInterval ().
Sets the authentication data to authData .
Authentication data can only be used if an authentication method has been specified.
另请参阅 authenticationData () 和 authenticationMethod ().
Sets the authentication method to authMethod .
另请参阅 authenticationMethod () 和 authenticationData ().
Sets the maximum packet size to packetSize . The maximum packet size specifies the maximum size one packet can contain. This includes the packet header and its properties.
If no maximum packet size is specified, no limit is imposed beyond the limitations of the protocol itself.
另请参阅 maximumPacketSize ().
Sets the maximum amount of QoS 1 and QoS 2 publications that the client is willing to process concurrently for this session to maximumReceive .
A maximum receive value of 0 is not allowed.
另请参阅 maximumReceive ().
Sets the maximum topic alias to alias . The maximum topic alias specifies the highest value that the client will accept from the server. The client uses this value to limit the number of topic aliases it is willing to hold for the connection.
The default value is 0. 0 indicates that the client does not accept any topic aliases on this connection.
另请参阅 maximumTopicAlias ().
Sets the request problem information to problem . A client uses this to request the server to return additional information in case of failure. Types of failure include connection and message management on the server side.
默认值为
false
, which indicates that the client must not receive any problem information for anything but connection management. The server still may send problem information for connection handling. If the value is
true
, the server may return problem information.
Problem information is available in user properties or reason strings of the property classes.
另请参阅 requestProblemInformation ().
Sets the request response information to response . A client uses this to request the server to return response information after the connection request has been handled.
默认值为
false
, which indicates that the client must not return any response information. If the value is
true
, the server may return response information, but is not enforced to do so.
另请参阅 requestResponseInformation ().
Sets the session expiry interval to expiry . The session expiry interval specifies the number of seconds a server holds information on the client state after a connection has been closed.
The default value is 0, which specifies that the session is closed when the network connection ends. If the value is specified as maximum of quint32, then the session does not expire.
另请参阅 sessionExpiryInterval ().
Sets the user properties of the connection to properties .
The default value is to not send any user information.
另请参阅 userProperties ().
Returns the user properties for the connection.
另请参阅 setUserProperties ().